From: Doug Evans Date: Sat, 13 Dec 2014 22:04:05 +0000 (-0800) Subject: utils.c (make_hex_string): Fix off-by-one error. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dc4d68869c3c700b629bd9f12076bd7fbd35aa49;p=binutils-gdb.git utils.c (make_hex_string): Fix off-by-one error. gdb/ChangeLog: * utils.c (make_hex_string): Fix off-by-one error. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 079be7772d7..f3a358e66a3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2014-12-13 Doug Evans + + * utils.c (make_hex_string): Fix off-by-one error. + 2014-12-13 Joel Brobecker * ada-lang.h (ada_ensure_varsize_limit): Declare. diff --git a/gdb/utils.c b/gdb/utils.c index ea2b18a801e..47adb67cb44 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; }