aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2014-12-13 10:19:03 -0500
committerJoel Brobecker <brobecker@adacore.com>2014-12-13 10:28:58 -0500
commit3c46a02f5083c4a9c07b563d44b8b6ded6d85bb1 (patch)
treea5c976ea3a4efa18926724e72213cbb8124a7d18 /gdb/utils.c
parent8e8347b895af2f492df694c621e70b101d8eb146 (diff)
downloadgdb-3c46a02f5083c4a9c07b563d44b8b6ded6d85bb1.zip
gdb-3c46a02f5083c4a9c07b563d44b8b6ded6d85bb1.tar.gz
gdb-3c46a02f5083c4a9c07b563d44b8b6ded6d85bb1.tar.bz2
Avoid use of sprintf in gdb/utils.c:make_hex_string
The use of sprintf is discouraged in GDB. Use xsnprintf instead. gdb/ChangeLog: * utils.c (make_hex_string): Replace use of sprintf by use of xsnprintf. Tested on x86_64-linux.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 1ab183c..ea2b18a 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1124,7 +1124,7 @@ make_hex_string (const gdb_byte *data, size_t length)
p = result;
for (i = 0; i < length; ++i)
- p += sprintf (p, "%02x", data[i]);
+ p += xsnprintf (p, 2, "%02x", data[i]);
*p = '\0';
return result;
}