aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDoug Evans <xdje42@gmail.com>2014-12-13 14:04:05 -0800
committerDoug Evans <xdje42@gmail.com>2014-12-13 14:04:05 -0800
commitdc4d68869c3c700b629bd9f12076bd7fbd35aa49 (patch)
treeefaf2c58fb1583b162c2e2c4bdfad5d08107b0cd /gdb
parentc1b5a1a6e732a65350af930c499b23018f8663cc (diff)
downloadfsf-binutils-gdb-dc4d68869c3c700b629bd9f12076bd7fbd35aa49.zip
fsf-binutils-gdb-dc4d68869c3c700b629bd9f12076bd7fbd35aa49.tar.gz
fsf-binutils-gdb-dc4d68869c3c700b629bd9f12076bd7fbd35aa49.tar.bz2
utils.c (make_hex_string): Fix off-by-one error.
gdb/ChangeLog: * utils.c (make_hex_string): Fix off-by-one error.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/utils.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 079be77..f3a358e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-13 Doug Evans <xdje42@gmail.com>
+
+ * utils.c (make_hex_string): Fix off-by-one error.
+
2014-12-13 Joel Brobecker <brobecker@adacore.com>
* ada-lang.h (ada_ensure_varsize_limit): Declare.
diff --git a/gdb/utils.c b/gdb/utils.c
index ea2b18a..47adb67 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 += xsnprintf (p, 2, "%02x", data[i]);
+ p += xsnprintf (p, 3, "%02x", data[i]);
*p = '\0';
return result;
}