aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-08-09 14:57:30 +0000
committerAndrew Cagney <cagney@redhat.com>2003-08-09 14:57:30 +0000
commit9ebf4acf536cf0f7583ac669ee55bcdeb12296b3 (patch)
tree5e71a10d8d7a02c80176e6c3ab10bf35538313c1 /gdb/utils.c
parent3771659b8b8b47b9fe8247afbbf5a7da9431a4d0 (diff)
downloadgdb-9ebf4acf536cf0f7583ac669ee55bcdeb12296b3.zip
gdb-9ebf4acf536cf0f7583ac669ee55bcdeb12296b3.tar.gz
gdb-9ebf4acf536cf0f7583ac669ee55bcdeb12296b3.tar.bz2
2003-08-09 Andrew Cagney <cagney@redhat.com>
* defs.h (xstrprintf): Declare. * utils.c (xstrprintf): New function. * breakpoint.c (insert_breakpoints): Replace sprintf and non-literal format strings, with xstrprintf and cleanups. (delete_breakpoint,breakpoint_re_set): Ditto. (commands_command, insert_breakpoints): Ditto. (bpstat_stop_status, break_at_finish_at_depth_command_1): Ditto. (break_at_finish_command_1): Ditto.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index a7c22ee..ae28c04 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1178,6 +1178,17 @@ xfree (void *ptr)
/* Like asprintf/vasprintf but get an internal_error if the call
fails. */
+char *
+xstrprintf (const char *format, ...)
+{
+ char *ret;
+ va_list args;
+ va_start (args, format);
+ xvasprintf (&ret, format, args);
+ va_end (args);
+ return ret;
+}
+
void
xasprintf (char **ret, const char *format, ...)
{