diff --git a/procio.c b/procio.c index 2813cd51..f3258ff6 100644 --- a/procio.c +++ b/procio.c @@ -251,7 +251,7 @@ ssize_t proc_write(void *c, const char *buf, size_t count) if (cookie->offset > LINELEN) token = (char*)memrchr(cookie->buf+offset, cookie->delim, LINELEN); else - token = (char*)memrchr(cookie->buf+offset, '\n', LINELEN); + token = (char*)memrchr(cookie->buf+offset, '\n', cookie->offset); if (token) *token = '\n'; else {