Module Name: src
Committed By: joerg
Date: Tue Mar 25 21:07:59 UTC 2014
Modified Files:
src/usr.sbin/rtsold: rtsold.c
Log Message:
Don't modify format string, use asprintf to format the original msg and
syslog the result.
To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/rtsold/rtsold.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/rtsold/rtsold.c
diff -u src/usr.sbin/rtsold/rtsold.c:1.41 src/usr.sbin/rtsold/rtsold.c:1.42
--- src/usr.sbin/rtsold/rtsold.c:1.41 Tue Mar 25 17:17:44 2014
+++ src/usr.sbin/rtsold/rtsold.c Tue Mar 25 21:07:59 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: rtsold.c,v 1.41 2014/03/25 17:17:44 joerg Exp $ */
+/* $NetBSD: rtsold.c,v 1.42 2014/03/25 21:07:59 joerg Exp $ */
/* $KAME: rtsold.c,v 1.77 2004/01/03 01:35:13 itojun Exp $ */
/*
@@ -661,9 +661,10 @@ warnmsg(int priority, const char *func,
if (priority <= log_upto)
vwarnx(msg, ap);
} else {
- char buf[BUFSIZ];
- snprintf(buf, sizeof(buf), "<%s> %s", func, msg);
- vsyslog(priority, buf, ap);
+ char *buf;
+ evasprintf(&buf, msg, ap);
+ syslog(priority, "<%s> %s", func, buf);
+ free(buf);
}
va_end(ap);
}