summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2014-11-21 07:44:25 +0000
committerdlg <dlg@openbsd.org>2014-11-21 07:44:25 +0000
commit2af84a8cb19ebc3b37d08483a4563db54f293381 (patch)
treedd3fe43be97978417298158f21e665ee2f6cab3f
parentsomebody permitted simple_locks back into uvm. they will be referred to (diff)
downloadwireguard-openbsd-2af84a8cb19ebc3b37d08483a4563db54f293381.tar.xz
wireguard-openbsd-2af84a8cb19ebc3b37d08483a4563db54f293381.zip
libraries shouldnt print to stderr when things dont go their way.
switch fprintf(stderr) over to event_warn() on malloc failure. fix up an errant newline in an existing event_warn while there. originally i just wanted to delete the fprintf diff from nicm@ who is away from a keyboard right now so cant commit guenther@ agrees with the idea
-rw-r--r--lib/libevent/buffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libevent/buffer.c b/lib/libevent/buffer.c
index baa7a21da67..6085e4d8b02 100644
--- a/lib/libevent/buffer.c
+++ b/lib/libevent/buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.c,v 1.26 2014/10/30 16:45:37 bluhm Exp $ */
+/* $OpenBSD: buffer.c,v 1.27 2014/11/21 07:44:25 dlg Exp $ */
/*
* Copyright (c) 2002, 2003 Niels Provos <provos@citi.umich.edu>
@@ -198,7 +198,7 @@ evbuffer_readline(struct evbuffer *buffer)
return (NULL);
if ((line = malloc(i + 1)) == NULL) {
- fprintf(stderr, "%s: out of memory\n", __func__);
+ event_warn("%s: out of memory", __func__);
return (NULL);
}
@@ -294,7 +294,7 @@ evbuffer_readln(struct evbuffer *buffer, size_t *n_read_out,
n_to_drain = end_of_eol - data;
if ((line = malloc(n_to_copy+1)) == NULL) {
- event_warn("%s: out of memory\n", __func__);
+ event_warn("%s: out of memory", __func__);
return (NULL);
}