summaryrefslogtreecommitdiffstats
path: root/lib/libevent/buffer.c
diff options
context:
space:
mode:
authorbrad <brad@openbsd.org>2005-06-18 01:52:22 +0000
committerbrad <brad@openbsd.org>2005-06-18 01:52:22 +0000
commit348ce57b33c699bae302b76b51b48d118e1449ea (patch)
treefa2c592629e1f9fe242c4a0a8c9d696047f0ed34 /lib/libevent/buffer.c
parentsync (diff)
downloadwireguard-openbsd-348ce57b33c699bae302b76b51b48d118e1449ea.tar.xz
wireguard-openbsd-348ce57b33c699bae302b76b51b48d118e1449ea.zip
update to libevent 1.1a; keep local changes
ok grunk@
Diffstat (limited to 'lib/libevent/buffer.c')
-rw-r--r--lib/libevent/buffer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libevent/buffer.c b/lib/libevent/buffer.c
index 446f1d9ba2d..379415a7f33 100644
--- a/lib/libevent/buffer.c
+++ b/lib/libevent/buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.c,v 1.5 2005/05/04 03:17:48 brad Exp $ */
+/* $OpenBSD: buffer.c,v 1.6 2005/06/18 01:52:22 brad Exp $ */
/*
* Copyright (c) 2002, 2003 Niels Provos <provos@citi.umich.edu>
@@ -186,10 +186,10 @@ evbuffer_remove(struct evbuffer *buf, void *data, size_t datlen)
char *
evbuffer_readline(struct evbuffer *buffer)
{
- char *data = EVBUFFER_DATA(buffer);
+ u_char *data = EVBUFFER_DATA(buffer);
size_t len = EVBUFFER_LENGTH(buffer);
char *line;
- int i;
+ u_int i;
for (i = 0; i < len; i++) {
if (data[i] == '\r' || data[i] == '\n')
@@ -334,7 +334,7 @@ evbuffer_read(struct evbuffer *buf, int fd, int howmuch)
#endif
#ifdef FIONREAD
- if (ioctl(fd, FIONREAD, &n) == -1)
+ if (ioctl(fd, FIONREAD, &n) == -1 || n == 0)
n = EVBUFFER_MAX_READ;
#endif
if (howmuch < 0 || howmuch > n)