summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.c b/main.c
index f180c30..3f16cd5 100644
--- a/main.c
+++ b/main.c
@@ -98,7 +98,7 @@ retry:
cur = buf;
buf = proc->log_buf;
- while ((cur = memchr(cur, '\n', len))) {
+ while (len > 0 && (cur = memchr(cur, '\n', len))) {
*cur = 0;
if (!proc->log_overflow)