diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2018-08-22 10:55:28 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2018-08-22 10:55:28 -0400 |
commit | 467dc1e2ea5a8b300b61194aa8565829ce7d65bc (patch) | |
tree | 8e7a937f9c0a1c739b9d2bef6ddd9c0a9a0dca38 /gdb/guile/scm-utils.c | |
parent | 6d52907e226ade45d5f5196eaed8386affda5156 (diff) | |
download | binutils-467dc1e2ea5a8b300b61194aa8565829ce7d65bc.zip binutils-467dc1e2ea5a8b300b61194aa8565829ce7d65bc.tar.gz binutils-467dc1e2ea5a8b300b61194aa8565829ce7d65bc.tar.bz2 |
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.
Diffstat (limited to 'gdb/guile/scm-utils.c')
-rw-r--r-- | gdb/guile/scm-utils.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/guile/scm-utils.c b/gdb/guile/scm-utils.c index c514c82..f8603a7 100644 --- a/gdb/guile/scm-utils.c +++ b/gdb/guile/scm-utils.c @@ -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. */ |