binutils-gdb/gdb/nat
Yao Qi 97e64e5ab1 Replace sprintf with xsnprintf in nat/linux-osdata.c
I see the following build warning when I build GDB with GCC trunk.

../../binutils-gdb/gdb/nat/linux-osdata.c: In function ‘LONGEST linux_xfer_osdata_fds(gdb_byte*, ULONGEST, ULONGEST)’:
../../binutils-gdb/gdb/nat/linux-osdata.c:767:1: error: ‘%s’ directive writing between 0 and 255 bytes into a region of size 11 [-Werror=format-length=]
 linux_xfer_osdata_fds (gdb_byte *readbuf,
 ^~~~~~~~~~~~~~~~~~~~~
../../binutils-gdb/gdb/nat/linux-osdata.c:800:51: note: format output between 7 and 262 bytes into a destination of size 17
        sprintf (procentry, "/proc/%s", dp->d_name);
                                                   ^
../../binutils-gdb/gdb/nat/linux-osdata.c: In function ‘LONGEST linux_xfer_osdata_threads(gdb_byte*, ULONGEST, ULONGEST)’:
../../binutils-gdb/gdb/nat/linux-osdata.c:555:1: error: ‘%s’ directive writing between 0 and 255 bytes into a region of size 11 [-Werror=format-length=]
 linux_xfer_osdata_threads (gdb_byte *readbuf,
 ^~~~~~~~~~~~~~~~~~~~~~~~~
../../binutils-gdb/gdb/nat/linux-osdata.c:588:51: note: format output between 7 and 262 bytes into a destination of size 17
        sprintf (procentry, "/proc/%s", dp->d_name);
                                                   ^
cc1plus: all warnings being treated as errors

The warning is a false positive, but we can workaround it by replacing
sprintf with xsnprintf.  On the other hand, it is always preferred to
use xsnprintf.

gdb:

2016-09-23  Yao Qi  <yao.qi@linaro.org>

	* nat/linux-osdata.c (linux_xfer_osdata_threads): Replace
	sprintf with xsnprintf.
	(linux_xfer_osdata_fds): Likewise.
2016-09-23 17:27:26 +01:00
..
aarch64-linux-hw-point.c Fix ARMv8.1/v8.2 for hw watchpoint and breakpoint 2016-07-23 10:10:32 -07:00
aarch64-linux-hw-point.h Fix ARMv8.1/v8.2 for hw watchpoint and breakpoint 2016-07-23 10:10:32 -07:00
aarch64-linux.c Sync proc_service definition with GLIBC 2016-08-25 08:42:03 +01:00
aarch64-linux.h Sync proc_service definition with GLIBC 2016-08-25 08:42:03 +01:00
amd64-linux-siginfo.c Fix PR gdb/20287 - x32 and "gdb_static_assert (sizeof (nat_siginfo_t) == sizeof (siginfo_t))" 2016-07-26 19:35:40 +01:00
amd64-linux-siginfo.h Adaptation of siginfo fixup for the new bnd fields 2016-02-02 12:02:16 +01:00
gdb_ptrace.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
gdb_thread_db.h Remove unused libthread_db td_thr_validate reference 2016-05-23 13:26:47 +01:00
glibc_thread_db.h Move shared native target specific code to gdb/nat 2014-06-20 14:06:48 +01:00
linux-btrace.c Remove trademark acknowledgements throughout 2016-01-12 15:03:11 +00:00
linux-btrace.h Remove trademark acknowledgements throughout 2016-01-12 15:03:11 +00:00
linux-namespaces.c Fix gdbserver build failure on targets without fork 2016-01-18 11:39:42 +00:00
linux-namespaces.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
linux-nat.h linux-nat: Add function lwp_is_stepping 2016-09-16 19:25:55 +02:00
linux-osdata.c Replace sprintf with xsnprintf in nat/linux-osdata.c 2016-09-23 17:27:26 +01:00
linux-osdata.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
linux-personality.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
linux-personality.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
linux-procfs.c linux-procfs: Handle lowercase "t (tracing stop)" state 2016-07-25 12:58:38 +01:00
linux-procfs.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
linux-ptrace.c Fix fallout from gdb/20413's fix (x32: linux_ptrace_test_ret_to_nx: Cannot PTRACE_PEEKUSER) 2016-08-11 12:01:22 +01:00
linux-ptrace.h MIPS/Linux: Also recognize TRAP_BRKPT and TRAP_HWBKPT 2016-04-15 23:52:00 +01:00
linux-waitpid.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
linux-waitpid.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mips-linux-watch.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
mips-linux-watch.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
ppc-linux.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
ppc-linux.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
x86-cpuid.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
x86-dregs.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
x86-dregs.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
x86-gcc-cpuid.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
x86-linux-dregs.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
x86-linux-dregs.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
x86-linux.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
x86-linux.h GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00