summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common.c b/src/common.c
index cddefb915..0e7aac955 100644
--- a/src/common.c
+++ b/src/common.c
@@ -55,14 +55,16 @@ char* strerror(int errno)
/* Report on errors and exit
*/
+#define BUFSIZE 1024
+
void
fatal(const char* ident, int exitcode, const char* format, ...)
{
- char log_entry[1024];
+ char log_entry[BUFSIZE];
va_list arg_ptr;
va_start(arg_ptr, format);
- vsprintf(log_entry, format, arg_ptr);
+ vsnprintf(log_entry, BUFSIZE, format, arg_ptr);
va_end(arg_ptr);
#ifdef HAVE_SYSLOG