When Shantonu wrote the new, more portable dtimep.lex, he left out the #ifdef
[mmh] / sbr / m_getfld.c
index 0db7bd9..a667be8 100644 (file)
@@ -578,7 +578,7 @@ m_unknown(FILE *iob)
     pat_map = (unsigned char **) calloc (256, sizeof(unsigned char *));
 
     for (cp = (char *) fdelim + 1; cp < (char *) delimend; cp++ )
-       pat_map[(int)*cp] = (unsigned char *) cp;
+       pat_map[(unsigned char)*cp] = (unsigned char *) cp;
 
     if (msg_style == MS_MMDF) {
        /* flush extra msg hdrs */
@@ -730,7 +730,8 @@ matchc(int patln, char *pat, int strln, char *str)
                while (pc != *str++)
                        if (str > es)
                                return 0;
-
+               if (str > es+1)
+                       return 0;
                sp = str; pp = pat;
                while (pp < ep && *sp++ == *pp)
                        pp++;