This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] ARI fixes: Remove some sprintf calls


"Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr> writes:

> Index: charset.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/charset.c,v
> retrieving revision 1.50
> diff -u -p -r1.50 charset.c
> --- charset.c	17 Apr 2012 15:47:09 -0000	1.50
> +++ charset.c	8 Nov 2012 15:03:14 -0000
> @@ -531,7 +531,7 @@ convert_between_encodings (const char *f
>  		  {
>  		    char octal[5];
>  
> -		    sprintf (octal, "\\%.3o", *inp & 0xff);
> +		    xsnprintf (octal, 5, "\\%.3o", *inp & 0xff);

sizeof(octal)?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]