--- kerneloops-0.4.clean/dmesg.c 2007-12-18 04:52:29.000000000 +0300 +++ kerneloops-0.4.orig/dmesg.c 2007-12-18 13:26:00.000000000 +0300 @@ -53,13 +53,17 @@ while (c) { /* in /var/log/messages, we need to strip the first part off, upto the 3rd ':' */ if (remove_syslog) { - char *c2;; + char *c2; /* skip non-kernel lines */ c2 = strstr(c, "kernel:"); if (!c2) { c2 = strchr(c,'\n'); - if (c2) + if (c2) { c = c2+1; + } else { + /* no 'kernel:' prefix, no line end -> reached the end of the buffer */ + break; + } continue; } c = strchr(c, ':');