On Sat, Jun 8, 2019 at 2:25 AM Nicolas George <[email protected]> wrote:
> Jun Li (12019-06-07): > > I think a complete validation should be creating a function like > "atodigit" > > , string to digit, instead of using atoi, > > The problem of validation is a common one, and as such it already has a > solution. > > APPLICATION USAGE > > The atoi() function is subsumed by strtol() but is retained because it > is > used extensively in existing code. If the number is not known to be in > range, strtol() should be used because atoi() is not required to > perform > any error checking. Thanks Nicolas and Michael, it is very helpful. After reread the exif orientation doc, I realized that the correct value should be in range [1,8], that is, 0 is considered as invalid. So the new version is still using "atoi", since it return 0 for either input "0" or "This is a test", and 0 considered as invalid in any case. https://patchwork.ffmpeg.org/patch/13471/ I am not against using strtol, which is a superset of atoi. Let me know if there is a code preference in ffmpeg since I see strtol is more widely used. Best Regards, Jun > > Regards, > > -- > Nicolas George > _______________________________________________ > ffmpeg-devel mailing list > [email protected] > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > [email protected] with subject "unsubscribe". _______________________________________________ ffmpeg-devel mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
