X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fm_getfld.c;h=8a18e783c98a294f1c9ebb07ee36e46accce278c;hp=cddf362b2d582a61b390023e592aab45e1d17bad;hb=dee387b53ab0d42922f857b60d6f980c9e79d16f;hpb=8563731b02ce9d750806f6b1769af8b399d964e8 diff --git a/sbr/m_getfld.c b/sbr/m_getfld.c index cddf362..8a18e78 100644 --- a/sbr/m_getfld.c +++ b/sbr/m_getfld.c @@ -6,7 +6,7 @@ */ #include -#include +#include /* This module has a long and checkered history. First, it didn't burst maildrops correctly because it considered two CTRL-A:s in a row to be @@ -184,6 +184,7 @@ static int (*eom_action)() = NULL; # define _ptr _p /* Gag */ # define _cnt _r /* Retch */ # define _filbuf __srget /* Puke */ +# define DEFINED__FILBUF_TO_SOMETHING_SPECIFIC #endif #ifdef SCO_5_STDIO @@ -191,6 +192,11 @@ static int (*eom_action)() = NULL; # define _cnt __cnt # define _base __base # define _filbuf(fp) ((fp)->__cnt = 0, __filbuf(fp)) +# define DEFINED__FILBUF_TO_SOMETHING_SPECIFIC +#endif + +#ifndef DEFINED__FILBUF_TO_SOMETHING_SPECIFIC +extern int _filbuf(FILE*); #endif @@ -572,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[*cp] = (unsigned char *) cp; + pat_map[(unsigned char)*cp] = (unsigned char *) cp; if (msg_style == MS_MMDF) { /* flush extra msg hdrs */ @@ -724,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++;