summaryrefslogtreecommitdiffabout
path: root/lib
authorSergey Poznyakoff <gray@gnu.org.ua>2004-06-19 16:23:35 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2004-06-19 16:23:35 (GMT)
commit5dc7f10652f61bdaa0418bc31d614c1e9a2d64a1 (patch) (side-by-side diff)
tree3eb3fc11b363ec7f48d6d6b9151272e5ec5e7f60 /lib
parentc48139777a5cbdf9cab47374b7b77cbcb19d2684 (diff)
downloadanubis-5dc7f10652f61bdaa0418bc31d614c1e9a2d64a1.tar.gz
anubis-5dc7f10652f61bdaa0418bc31d614c1e9a2d64a1.tar.bz2
(_auth_lb_writelines): Bugfix.
Diffstat (limited to 'lib') (more/less context) (ignore whitespace changes)
-rw-r--r--lib/lbuf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/lbuf.c b/lib/lbuf.c
index 48b6338..0ceadfd 100644
--- a/lib/lbuf.c
+++ b/lib/lbuf.c
@@ -122,9 +122,11 @@ _auth_lb_writelines (struct _line_buffer *s, const char *iptr, size_t isize,
{
char *start, *end;
- for (start = s->buffer, end = strchr (start, '\n');
+ for (start = s->buffer,
+ end = memchr (start, '\n', s->buffer + s->level - start);
end && end < s->buffer + s->level;
- start = end + 1, end = strchr (start, '\n'))
+ start = end + 1,
+ end = memchr (start, '\n', s->buffer + s->level - start))
if (end[-1] == '\r')
{
int rc = wr (data, start, end);
@@ -136,7 +138,7 @@ _auth_lb_writelines (struct _line_buffer *s, const char *iptr, size_t isize,
{
if (start < s->buffer + s->level)
{
- int rest = s->buffer + s->level - start + 1;
+ int rest = s->buffer + s->level - start;
memmove (s->buffer, start, rest);
s->level = rest;
}

Return to:

Send suggestions and report system problems to the System administrator.