--- msg.c 2001/08/27 14:29:11 1.11
+++ msg.c 2001/08/27 14:49:32 1.12
@@ -74,19 +74,19 @@
* msg->cpMsg
* must contain the wholly RFC0822 formatted message with native
* (unescaped) dots at the beginning of a line, the 'From ' envelope,
- * headers, double newline, body, '\0', no trailing dot;
+ * headers, double newline, body, NUL, no trailing dot;
*
* OUTPUTS
*
* msg->azHeaders, msg->asHeaders contains the headers in argz format, one
- * logical '\0'-terminated line per header which might be wrapped into
+ * logical NUL-terminated line per header which might be wrapped into
* multiple '\n'-ended physical lines. The "From " envelope, "Received:",
* "Path:", "To:" and "Cc:" headers are removed silently. The
* "Newsgroups:" and "Message-ID" headers are removed and their values are
* stored in separate structures (see below).
*
* msg->cpBody
- * contains the unmodified body of the message, '\0'-terminated, no
+ * contains the unmodified body of the message, NUL-terminated, no
* trailing dot.
*
* msg->cpMsgid
@@ -228,7 +228,7 @@
if ((aHeaders = (char **)malloc((argz_count(msg->azHeaders, msg->asHeaders) + 1) * sizeof(char *))) == NULL)
return MSG_ERR_MEM;
argz_extract(msg->azHeaders, msg->asHeaders, aHeaders);
- /* replace the trailing '\0', which is *(cp-1) of the predecessor, with a
+ /* replace the trailing NUL, which is *(cp-1) of the predecessor, with a
* space at every second string. Break action when terminating NULL string
* is detected */
i=0;
@@ -257,7 +257,7 @@
if (strlen(cp) > WRAPAT) {
cpRem = cp;
cpWrap = NULL;
- for (o = 0; (cpRem[o] != ':') && (cpRem[o] != '\0'); o++); /* offset name so at least one char of value remains in first line */
+ for (o = 0; (cpRem[o] != ':') && (cpRem[o] != NUL); o++); /* offset name so at least one char of value remains in first line */
o += 2; /* skip ": " */
while ((strlen(cpRem) + (cpWrap == NULL ? 0 : strlen(WRAPUSING))) > WRAPAT) {
for (i = WRAPAT - 1 - (cpWrap == NULL ? 0 : strlen(WRAPUSING)); (i >= o) && !isblank(cpRem[i]); i--);
@@ -265,13 +265,13 @@
i = WRAPAT - 1 - (cpWrap == NULL ? 0 : strlen(WRAPUSING) - 1); /* sorry, forced cut at non-blank */
cpCut = cpRem;
cpRem += i;
- for (; (isblank(*cpRem) && (*cpRem != '\0')); cpRem++); /* skip next lines leading blanks */
+ for (; (isblank(*cpRem) && (*cpRem != NUL)); cpRem++); /* skip next lines leading blanks */
for (; (i >= o) && isblank(cpCut[i-1]); i--); /* chop off this lines trailing blanks */
if (i >= o) { /* only keep line fragment if some non-blanks inside */
if (cpWrap == NULL) {
if ((cpWrap = (char *)malloc(i+strlen(WRAPUSING)+1)) == NULL)
return MSG_ERR_MEM;
- *cpWrap = '\0';
+ *cpWrap = NUL;
o = 1;
}
else {
@@ -298,12 +298,12 @@
cpHeaders = msg->azHeaders;
/********************************************************************
- * header + CRLF + body + '.' + CRLF + '\0', replacing NL with CRLF *
+ * header + CRLF + body + '.' + CRLF + NUL, replacing NL with CRLF *
********************************************************************/
n = 0;
/* count size of headers, reserve space for NL to CRLF conversion */
- for (i = 0; ((c = cpHeaders[i]) != '\0'); i++) {
+ for (i = 0; ((c = cpHeaders[i]) != NUL); i++) {
if (c == '\n')
n++;
n++;
@@ -315,7 +315,7 @@
n+=2;
/* count size of body, reserve space for NL-DOT escape and NL to CRLF conversion */
cOld = '\n';
- for (i = 0; ((c = msg->cpBody[i]) != '\0'); i++) {
+ for (i = 0; ((c = msg->cpBody[i]) != NUL); i++) {
if (c == '\n')
n++;
if (c == '.' && cOld == '\n')
@@ -334,7 +334,7 @@
n = 0;
/* copy headers, do NL to CRLF conversion */
- for (i = 0; ((c = cpHeaders[i]) != '\0'); i++) {
+ for (i = 0; ((c = cpHeaders[i]) != NUL); i++) {
if (c == '\n')
msg->cpMsg[n++] = '\r';
msg->cpMsg[n++] = c;
@@ -349,7 +349,7 @@
msg->cpMsg[n++] = '\n';
/* copy body, do NL-DOT escape and NL to CRLF conversion */
cOld = '\n';
- for (i = 0; ((c = msg->cpBody[i]) != '\0'); i++) {
+ for (i = 0; ((c = msg->cpBody[i]) != NUL); i++) {
if (c == '\n')
msg->cpMsg[n++] = '\r';
if (c == '.' && cOld == '\n')
@@ -366,7 +366,7 @@
msg->cpMsg[n++] = '.';
msg->cpMsg[n++] = '\r';
msg->cpMsg[n++] = '\n';
- msg->cpMsg[n] = '\0';
+ msg->cpMsg[n] = NUL;
return MSG_OK;
}
|