From d0578da02a99c4b5880d14fffbd8834b81fa3b7e Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 4 Nov 2010 03:56:20 +0000 Subject: Fix problem with using va_list twice which leads to crash on 64-bit --- tools/notify-dns-slaves.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/notify-dns-slaves.c b/tools/notify-dns-slaves.c index 7a334e9..e2c3325 100644 --- a/tools/notify-dns-slaves.c +++ b/tools/notify-dns-slaves.c @@ -179,6 +179,7 @@ vmessage(int level, int erno, const char* msg, va_list ap) { #define MAX_MSGLEN 1024 char buf[MAX_MSGLEN]; + va_list ap2; size_t len; #if LOG_NORMAL @@ -187,6 +188,7 @@ vmessage(int level, int erno, const char* msg, va_list ap) #endif assert (msg); + va_copy (ap2, ap); strncpy (buf, msg, MAX_MSGLEN); buf[MAX_MSGLEN - 1] = 0; @@ -206,7 +208,7 @@ vmessage(int level, int erno, const char* msg, va_list ap) #endif vsyslog (level, buf, ap); - vwarnx (buf, ap); + vwarnx (buf, ap2); } static void -- cgit v1.2.3