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:
Simon Marchi
2018-08-22 10:55:28 -04:00
committed by Simon Marchi
parent 6d52907e22
commit 467dc1e2ea
5 changed files with 18 additions and 18 deletions

View File

@ -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. */