mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 19:09:31 +08:00
Replace xstrvprintf usages with string_vprintf
Most usages of xstrvprintf in GDB can be replaced with string_vprintf, removing some manual memory management. gdb/ChangeLog: * guile/scm-string.c (gdbscm_scm_from_printf): Use string_vprintf. * guile/scm-utils.c (gdbscm_printf): Likewise. * serial.c (serial_printf): Likewise. * xml-support.c (gdb_xml_parser::vdebug): Likewise.
This commit is contained in:

committed by
Simon Marchi

parent
6d52907e22
commit
467dc1e2ea
@ -79,13 +79,11 @@ void
|
||||
gdbscm_printf (SCM port, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
char *string;
|
||||
|
||||
va_start (args, format);
|
||||
string = xstrvprintf (format, args);
|
||||
std::string string = string_vprintf (format, args);
|
||||
va_end (args);
|
||||
scm_puts (string, port);
|
||||
xfree (string);
|
||||
scm_puts (string.c_str (), port);
|
||||
}
|
||||
|
||||
/* Utility for calling from gdb to "display" an SCM object. */
|
||||
|
Reference in New Issue
Block a user