Fix uip/whom.c for C89 compatibility
[mmh] / uip / sortm.c
index 56fa7cb..c56a401 100644 (file)
@@ -41,6 +41,8 @@ static struct swit switches[] = {
         { NULL, 0 }
 };
 
+char *version=VERSION;
+
 struct smsg {
        int s_msg;
        time_t s_clock;
@@ -331,6 +333,9 @@ get_fields(char *datesw, int msg, struct smsg *smsg)
        }
        for (compnum = 1, state = FLD2;; compnum++) {
                switch (state = m_getfld2(state, &f, in)) {
+               case LENERR2:
+                       state = FLD2;
+                       /* FALL */
                case FLD2:
                        if (mh_strcasecmp(f.name, datesw)==0) {
                                datecomp = mh_xstrdup(f.value);
@@ -350,8 +355,11 @@ get_fields(char *datesw, int msg, struct smsg *smsg)
                case FILEEOF2:
                        break;
 
-               case LENERR2:
                case FMTERR2:
+                       admonish(NULL, "format error in message %d (header #%d)", msg, compnum);
+                       state = FLD2;
+                       continue;
+
                case IOERR2:
                        admonish(NULL, "format error in message %d (header #%d)", msg, compnum);
                        if (datecomp) {