[FFmpeg-devel] [PATCH] Decoding of raw UTF-8 text from Ogg streams
Sun Aug 16 15:32:00 CEST 2009
On Sun, Aug 16, 2009 at 12:25:54PM +0100, ogg.k.ogg.k at googlemail.com wrote:
> > A while ago, I realized that sscanf using %u would actually accept
> > negative numbers (eg, lexical minus signs in the input), and I'd end
> > up with large unsigned numbers. These would be accepted if I was
> To be preemptively pedantic: -somelargenumber that, when cast to
> unsigned, would be 0-59, would be be accepted.
If val is unsigned it will still be accepted with your patch, and
actually if the number cast to unsigned is in the area 0-59 the number
was in that area all the time since it returned from sscanf.
So I can't see how what you said would make any sense at all, except
that if this bothers you, you should maybe use strtol(l) for which the
behaviour for such cases is well-defined and can be checked for...
More information about the ffmpeg-devel