summaryrefslogtreecommitdiffstats
path: root/lib/libevent/log.c
diff options
context:
space:
mode:
authorbrad <brad@openbsd.org>2005-05-04 03:17:48 +0000
committerbrad <brad@openbsd.org>2005-05-04 03:17:48 +0000
commit1085edd87f9e20fc5dc5eabd649e9d4c15012e91 (patch)
treeecc66b67fdbefc67dc9494e97de6d2554a10a505 /lib/libevent/log.c
parentremove #ifdef __OpenBSD__ (diff)
downloadwireguard-openbsd-1085edd87f9e20fc5dc5eabd649e9d4c15012e91.tar.xz
wireguard-openbsd-1085edd87f9e20fc5dc5eabd649e9d4c15012e91.zip
update to libevent 1.0d; keep local changes
thanks to Alexander von Gernler for testing and some bug fixes ok mpf@ norby@
Diffstat (limited to 'lib/libevent/log.c')
-rw-r--r--lib/libevent/log.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/libevent/log.c b/lib/libevent/log.c
index 6038b389199..3d9b5000b25 100644
--- a/lib/libevent/log.c
+++ b/lib/libevent/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.3 2005/04/22 00:56:25 brad Exp $ */
+/* $OpenBSD: log.c,v 1.4 2005/05/04 03:17:48 brad Exp $ */
/*
* log.c
@@ -87,6 +87,17 @@ event_vsnprintf(char *str, size_t size, const char *format, va_list args)
return r;
}
+static int
+event_snprintf(char *str, size_t size, const char *format, ...)
+{
+ va_list ap;
+ int r;
+ va_start(ap, format);
+ r = event_vsnprintf(str, size, format, ap);
+ va_end(ap);
+ return r;
+}
+
void
event_err(int eval, const char *fmt, ...)
{
@@ -163,7 +174,7 @@ _warn_helper(int severity, int log_errno, const char *fmt, va_list ap)
if (log_errno >= 0) {
len = strlen(buf);
if (len < sizeof(buf) - 3) {
- snprintf(buf + len, sizeof(buf) - len, ": %s",
+ event_snprintf(buf + len, sizeof(buf) - len, ": %s",
strerror(log_errno));
}
}