mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-15 05:01:13 +08:00
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.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user