[FFmpeg-cvslog] ffprobe: make upcase_string() ignore non-ASCII characters

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Jan 10 20:30:59 CET 2012


On Tue, Jan 10, 2012 at 06:25:57PM +0100, Stefano Sabatini wrote:
> ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Sun Jan  8 11:10:06 2012 +0100| [d3e435164b0d86cf37290be6bbd22610342f936d] | committer: Stefano Sabatini
> 
> ffprobe: make upcase_string() ignore non-ASCII characters
> 
> This is required as some section names may contain non-ASCII characters
> (e.g. '_').
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d3e435164b0d86cf37290be6bbd22610342f936d
> ---
> 
>  ffprobe.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/ffprobe.c b/ffprobe.c
> index bdc3814..e16c8bf 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -417,7 +417,11 @@ static inline char *upcase_string(char *dst, size_t dst_size, const char *src)
>  {
>      int i;
>      for (i = 0; src[i] && i < dst_size-1; i++)
> -        dst[i] = src[i]-32;
> +        if (src[i] >= 'a' && src[i] <= 'z') {
> +            dst[i] = src[i]-32;
> +        } else {
> +            dst[i] = src[i];
> +        }

avstring.h contains av_toupper, I'd suggest to use that.


More information about the ffmpeg-cvslog mailing list