summaryrefslogtreecommitdiff
path: root/lib/libevent/buffer.c
diff options
context:
space:
mode:
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)