summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2010-11-04 03:56:20 +0000
committerStef Walter <stef@memberwebs.com>2010-11-04 03:56:20 +0000
commitd0578da02a99c4b5880d14fffbd8834b81fa3b7e (patch)
treeaafe84c6bad88489a2cdf8a9eb62cf240b4a0ec5
parent982ea06e104284d3a3db2f14b23780f529d33528 (diff)
Fix problem with using va_list twice which leads to crash on 64-bit
-rw-r--r--tools/notify-dns-slaves.c4
1 files changed, 3 insertions, 1 deletions
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