summaryrefslogtreecommitdiff
path: root/gdb/defs.h
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2005-03-17 22:11:09 +0000
committerMark Kettenis <kettenis@gnu.org>2005-03-17 22:11:09 +0000
commitddaa5c8b71156b7561c7641199dd9f52dd369e4b (patch)
treef3b70f8185a32465b41fa91f941d2c43ce50d733 /gdb/defs.h
parent38db30007792bca3138c3f53ebbfb90f9bebb6b2 (diff)
downloadgdb-ddaa5c8b71156b7561c7641199dd9f52dd369e4b.tar.gz
* defs.h (xsnprintf): New prototype.
* utils.c (xsnprintf): New function.
Diffstat (limited to 'gdb/defs.h')
-rw-r--r--gdb/defs.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/defs.h b/gdb/defs.h
index c14321a42a9..fa012a4d28b 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -879,6 +879,10 @@ extern void xvasprintf (char **ret, const char *format, va_list ap);
extern char *xstrprintf (const char *format, ...) ATTR_FORMAT (printf, 1, 2);
extern char *xstrvprintf (const char *format, va_list ap);
+/* Like snprintf, but throw an error if the output buffer is too small. */
+extern int xsnprintf (char *str, size_t size, const char *format, ...)
+ ATTR_FORMAT (printf, 3, 4);
+
extern int parse_escape (char **);
/* Message to be printed before the error message, when an error occurs. */