aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/nat')
-rw-r--r--gdb/nat/linux-osdata.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/nat/linux-osdata.c b/gdb/nat/linux-osdata.c
index bf98c96..5b407a4 100644
--- a/gdb/nat/linux-osdata.c
+++ b/gdb/nat/linux-osdata.c
@@ -585,7 +585,8 @@ linux_xfer_osdata_threads (gdb_byte *readbuf,
|| NAMELEN (dp) > sizeof ("4294967295") - 1)
continue;
- sprintf (procentry, "/proc/%s", dp->d_name);
+ xsnprintf (procentry, sizeof (procentry), "/proc/%s",
+ dp->d_name);
if (stat (procentry, &statbuf) == 0
&& S_ISDIR (statbuf.st_mode))
{
@@ -797,7 +798,8 @@ linux_xfer_osdata_fds (gdb_byte *readbuf,
|| NAMELEN (dp) > sizeof ("4294967295") - 1)
continue;
- sprintf (procentry, "/proc/%s", dp->d_name);
+ xsnprintf (procentry, sizeof (procentry), "/proc/%s",
+ dp->d_name);
if (stat (procentry, &statbuf) == 0
&& S_ISDIR (statbuf.st_mode))
{