projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use sysexits.h for better exit-codes
[mmh]
/
sbr
/
m_getfld.c
diff --git
a/sbr/m_getfld.c
b/sbr/m_getfld.c
index
a3852fe
..
12d05b9
100644
(file)
--- a/
sbr/m_getfld.c
+++ b/
sbr/m_getfld.c
@@
-9,6
+9,7
@@
#include <h/mh.h>
#include <h/utils.h>
#include <ctype.h>
#include <h/mh.h>
#include <h/utils.h>
#include <ctype.h>
+#include <sysexits.h>
/*
** This module has a long and checkered history.
/*
** This module has a long and checkered history.
@@
-563,7
+564,7
@@
m_getfld(int state, unsigned char *name, unsigned char *buf,
break;
default:
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;
}
finish:
*cp = 0;
@@
-599,10
+600,10
@@
thisisanmbox(FILE *iob)
*/
if (fread(text, sizeof(*text), 5, iob) != 5) {
*/
if (fread(text, sizeof(*text), 5, iob) != 5) {
- adios(NULL, "Read error");
+ adios(EX_IOERR, NULL, "Read error");
}
if (strncmp(text, "From ", 5)!=0) {
}
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 ";
}
ismbox = TRUE;
delimstr = "\nFrom ";
@@
-620,7
+621,7
@@
thisisanmbox(FILE *iob)
strcpy(msg_delim, delimstr);
delimend = (unsigned char *)msg_delim + edelimlen;
if (edelimlen <= 1)
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
/*
** 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