This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] ARI fixes: Remove some sprintf calls
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: <gdb-patches at sourceware dot org>
- Date: Thu, 08 Nov 2012 18:25:03 +0100
- Subject: Re: [RFA] ARI fixes: Remove some sprintf calls
- References: <4297.05661158568$1352387430@news.gmane.org>
"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."