Removed the trivial peekc() and put the code at the appropriate places.
[mmh] / uip / burst.c
index 725abec..fdc78f4 100644 (file)
@@ -216,11 +216,13 @@ find_delim(int msgnum, struct smsg *smsgs)
 
                for (c = 0; fgets(buffer, sizeof(buffer), in); c = buffer[0]) {
                        if (strncmp(buffer, delim3, ld3) == 0
-                                       && (msgp == 1 || c == '\n')
-                                       && ((cc = peekc(in)) == '\n' ||
-                                       cc == EOF))
-                               break;
-                       else
+                                       && (msgp == 1 || c == '\n')) {
+                               cc = getc(in);
+                               ungetc(cc, in);
+                               if (cc == '\n' || cc == EOF) {
+                                       break;
+                               }
+                       } else
                                pos += (long) strlen(buffer);
                }