On Sun, Dec 21, 2014 at 10:36:10PM +0100, Reimar Döffinger wrote:
> On 21.12.2014, at 21:09, Michael Niedermayer <michae...@gmx.at> wrote:
> > +    int j;
> > +
> > +    for (j = i = 1; i<argc; i++) {
> > +        if (av_isdigit(argv[i][0])) {
> > +            if (j++ == 1) {
> > +                retry_count = atoi(argv[i]);
> > +            } else
> > +                max_size = atoi(argv[i]);
> > +        } else {
> > +            single_format = argv[i];
> > +        }
> > +    }
> 
> I'm not sure it is worth spending much effort on, but it is messy.
> For example it will silently accept multiple non-integers and overwrite 
> single_format.
> Also strtol would be nicer than atoi which does no checking (related insofar 
> as it would be an alternative to isdigit).
> But maybe it would be best to simply check av_isdigit(argv[1][0]) and based 
> on that go into the one or the other path, no loops or anything and allowing 
> any arbitrary order...


not so hacky solution posted


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides

Attachment: signature.asc
Description: Digital signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to