summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2004-12-23 16:59:08 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2004-12-23 16:59:08 +0000
commit31747fe7321c8e695f34396977fea9659fc34235 (patch)
tree159e1547db6a3618b0790670d03b98242f737b42 /auth
parentea55eed92d9cf235ce78fd1e8a8c869673feb0fe (diff)
downloadmailutils-31747fe7321c8e695f34396977fea9659fc34235.tar.gz
mailutils-31747fe7321c8e695f34396977fea9659fc34235.tar.bz2
(_auth_lb_writelines): Bugfix
Diffstat (limited to 'auth')
-rw-r--r--auth/lbuf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/auth/lbuf.c b/auth/lbuf.c
index b405e900b..42227194d 100644
--- a/auth/lbuf.c
+++ b/auth/lbuf.c
@@ -123,9 +123,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);
@@ -137,7 +139,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.