X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fm_getfld.c;h=12d05b988a88a671e26caf136fe775844db30451;hb=1e9a7f8082f2ea4b496827be6b9ebbc4ac145839;hp=5bd6bbbaed434c578b577ce6a157f92d8e3b43ea;hpb=d50bc5836dcb94dc6b92e7953c7d0cf62469ee52;p=mmh diff --git a/sbr/m_getfld.c b/sbr/m_getfld.c index 5bd6bbb..12d05b9 100644 --- a/sbr/m_getfld.c +++ b/sbr/m_getfld.c @@ -8,6 +8,8 @@ #include #include +#include +#include /* ** This module has a long and checkered history. @@ -423,8 +425,8 @@ m_getfld(int state, unsigned char *name, unsigned char *buf, *cp++ = j = *(iob->_ptr + c); c = _filbuf(iob); #endif - if (c == EOF || - ((j == '\0' || j == '\n') && c != ' ' && c != '\t')) { + if (c == EOF || ((j == '\0' || j == '\n') + && c != ' ' && c != '\t')) { if (c != EOF) { #ifdef LINUX_STDIO --iob->_IO_read_ptr; @@ -562,7 +564,7 @@ m_getfld(int state, unsigned char *name, unsigned char *buf, break; default: - adios(NULL, "m_getfld() called with bogus state of %d", state); + adios(EX_SOFTWARE, NULL, "m_getfld() called with bogus state of %d", state); } finish: *cp = 0; @@ -598,10 +600,10 @@ thisisanmbox(FILE *iob) */ if (fread(text, sizeof(*text), 5, iob) != 5) { - adios(NULL, "Read error"); + adios(EX_IOERR, NULL, "Read error"); } if (strncmp(text, "From ", 5)!=0) { - adios(NULL, "No Unix style (mbox) maildrop."); + adios(EX_USAGE, NULL, "No Unix style (mbox) maildrop."); } ismbox = TRUE; delimstr = "\nFrom "; @@ -619,7 +621,7 @@ thisisanmbox(FILE *iob) strcpy(msg_delim, delimstr); delimend = (unsigned char *)msg_delim + edelimlen; if (edelimlen <= 1) - adios(NULL, "maildrop delimiter must be at least 2 bytes"); + adios(EX_DATAERR, NULL, "maildrop delimiter must be at least 2 bytes"); /* ** build a Boyer-Moore end-position map for the matcher in m_getfld. ** N.B. - we don't match just the first char (since it's the newline