From 995c29c08c70804756dedb1f048b6b8dad1d249d Mon Sep 17 00:00:00 2001 From: zacheiss Date: Thu, 24 Apr 2003 18:40:03 +0000 Subject: [PATCH] Simplify syslog_com_err_proc, and make it not drop the second argument on the floor. --- update/update_server.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/update/update_server.c b/update/update_server.c index f50fb525..7c23a69b 100644 --- a/update/update_server.c +++ b/update/update_server.c @@ -238,12 +238,10 @@ void child_handler(int signal) static void syslog_com_err_proc(const char *progname, long code, const char *fmt, va_list args) { - char *buf; - int bufsiz = 1024; + char buf[BUFSIZ + 1]; - buf = malloc(bufsiz + 1); - buf[bufsiz] = '\0'; + buf[BUFSIZ] = '\0'; - vsnprintf(buf, bufsiz, fmt, args); - syslog(LOG_NOTICE, "%s", buf); + vsnprintf(buf, BUFSIZ, fmt, args); + syslog(LOG_NOTICE, "%s: %s %s", progname, error_message(code), buf); } -- 2.45.1