utils.c (make_hex_string): Fix off-by-one error.
authorDoug Evans <xdje42@gmail.com>
Sat, 13 Dec 2014 22:04:05 +0000 (14:04 -0800)
committerDoug Evans <xdje42@gmail.com>
Sat, 13 Dec 2014 22:04:05 +0000 (14:04 -0800)
gdb/ChangeLog:

* utils.c (make_hex_string): Fix off-by-one error.

gdb/ChangeLog
gdb/utils.c

index 079be7772d76a19133bdffe41be9878b78a37438..f3a358e66a34588510e37c53e90a149a0d06fd7c 100644 (file)
@@ -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.
index ea2b18a801e8fc803df7ca6a38cb785ed26f9b55..47adb67cb44be26e43ea4c2e184051bf8194322b 100644 (file)
@@ -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;
 }