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
aarch64-linux-hw-point.h
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
gdb_ptrace.h
gdb_thread_db.h
glibc_thread_db.h
linux-btrace.c
linux-btrace.h
linux-namespaces.c
linux-namespaces.h
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
linux-personality.c
linux-personality.h
linux-procfs.c linux-procfs: Handle lowercase "t (tracing stop)" state 2016-07-25 12:58:38 +01:00
linux-procfs.h
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
linux-waitpid.c
linux-waitpid.h
mips-linux-watch.c
mips-linux-watch.h
ppc-linux.c
ppc-linux.h
x86-cpuid.h
x86-dregs.c
x86-dregs.h
x86-gcc-cpuid.h
x86-linux-dregs.c
x86-linux-dregs.h
x86-linux.c
x86-linux.h