Fix uip/whom.c for C89 compatibility
[mmh] / uip / scansbr.c
index feef5c0..48837d7 100644 (file)
@@ -107,6 +107,9 @@ scan(FILE *inb, int innum, int outnum, char *fmtstr, int width, int curflg,
        for (compnum = 1, state = FLD2; ; ) {
                state = m_getfld2(state, &f, inb);
                switch (state) {
+               case LENERR2:
+                       state = FLD2;
+                       /* FALL */
                case FLD2:
                        compnum++;
                        if (incing) {
@@ -191,19 +194,20 @@ body:;
                        }
                        goto finished;
 
-               case LENERR2:
-                       advise(NULL, "line \"%s\" too long", trim(f.value));
-                       goto handleerror;
-
                case FMTERR2:
                        if (strncmp("From ", f.value, 5)==0) {
                                state = FILEEOF2;
                                goto finished;
                        }
-                       /* FALL */
+                       state = FLD2;
+                       fprintf(stderr, innum ?
+                                       "??Format error (message %d) in " :
+                                       "??Format error in ",
+                                       outnum ? outnum : innum);
+                       fprintf(stderr, "component %d\n", compnum);
+                       continue;
 
                case IOERR2:
-handleerror:;
                        fprintf(stderr, innum ?
                                        "??Format error (message %d) in " :
                                        "??Format error in ",