[MPlayer-dev-eng] [PATCH 2/4] String handling audit/cleanup

Alex Beregszaszi alex at rtfs.hu
Sat Mar 3 23:13:06 CET 2007


Hi,

> 2)
> @@ -868,7 +869,7 @@ static int open_s(stream_t *stream,int m
>           int i;
>           char buf[33];
>           for (i = 0; i < 16; i ++)
> -          sprintf(buf+2*i, "%02X", discid[i]);
> +          snprintf(buf+2*i, sizeof buf - ((buf+2*i)-buf), "%02X", 
> discid[i]);

Actually that equals to: sizeof buf - 2*i

--
Alex Beregszaszi





More information about the MPlayer-dev-eng mailing list