projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Explicit checks for return values of strcmp().
[mmh]
/
uip
/
mhbuildsbr.c
diff --git
a/uip/mhbuildsbr.c
b/uip/mhbuildsbr.c
index
23163f7
..
f65b6e3
100644
(file)
--- a/
uip/mhbuildsbr.c
+++ b/
uip/mhbuildsbr.c
@@
-171,8
+171,8
@@
build_mime(char *infile)
}
/* get copies of the buffers */
}
/* get copies of the buffers */
- np = add(name, NULL);
- vp = add(buf, NULL);
+ np = getcpy(name);
+ vp = getcpy(buf);
/* if necessary, get rest of field */
while (state == FLDPLUS) {
/* if necessary, get rest of field */
while (state == FLDPLUS) {
@@
-214,7
+214,7
@@
finish_field:
** Now add the MIME-Version header field
** to the list of header fields.
*/
** Now add the MIME-Version header field
** to the list of header fields.
*/
- np = add(VRSN_FIELD, NULL);
+ np = getcpy(VRSN_FIELD);
vp = concat(" ", VRSN_VALUE, "\n", NULL);
add_header(ct, np, vp);
vp = concat(" ", VRSN_VALUE, "\n", NULL);
add_header(ct, np, vp);
@@
-227,7
+227,7
@@
finish_field:
done(1);
ct->c_type = CT_MULTIPART;
ct->c_subtype = MULTI_MIXED;
done(1);
ct->c_type = CT_MULTIPART;
ct->c_subtype = MULTI_MIXED;
- ct->c_file = add(infile, NULL);
+ ct->c_file = getcpy(infile);
if ((m = (struct multipart *) calloc(1, sizeof(*m))) == NULL)
adios(NULL, "out of memory");
if ((m = (struct multipart *) calloc(1, sizeof(*m))) == NULL)
adios(NULL, "out of memory");
@@
-424,7
+424,7
@@
user_content(FILE *in, char *file, char *buf, CT *ctp)
adios("mhbuildsbr", "unable to create temporary file");
/* use a temp file to collect the plain text lines */
adios("mhbuildsbr", "unable to create temporary file");
/* use a temp file to collect the plain text lines */
- ce->ce_file = add(cp, NULL);
+ ce->ce_file = getcpy(cp);
ce->ce_unlink = 1;
if (buf[0] == '#' && buf[1] == '<') {
ce->ce_unlink = 1;
if (buf[0] == '#' && buf[1] == '<') {
@@
-652,7
+652,7
@@
use_forw:
continue;
if (!*cp)
adios(NULL, "empty pipe command for #%s directive", ci->ci_type);
continue;
if (!*cp)
adios(NULL, "empty pipe command for #%s directive", ci->ci_type);
- cp = add(cp, NULL);
+ cp = getcpy(cp);
free(ci->ci_magic);
ci->ci_magic = cp;
} else {
free(ci->ci_magic);
ci->ci_magic = cp;
} else {
@@
-682,7
+682,7
@@
use_forw:
done(1);
}
}
done(1);
}
}
- ci->ci_magic = add(cp, NULL);
+ ci->ci_magic = getcpy(cp);
return OK;
}
return OK;
}
@@
-703,7
+703,7
@@
use_forw:
ap = brkstring(ci->ci_magic, " ", "\n");
copyip(ap, arguments, MAXARGS);
} else {
ap = brkstring(ci->ci_magic, " ", "\n");
copyip(ap, arguments, MAXARGS);
} else {
- arguments[0] = "cur";
+ arguments[0] = seq_cur;
arguments[1] = NULL;
}
folder = NULL;
arguments[1] = NULL;
}
folder = NULL;
@@
-715,13
+715,13
@@
use_forw:
if (folder)
adios(NULL, "only one folder per #forw directive");
else
if (folder)
adios(NULL, "only one folder per #forw directive");
else
- folder = pluspath(cp);
+ folder = getcpy(expandfol(cp));
}
}
/* else, use the current folder */
if (!folder)
}
}
/* else, use the current folder */
if (!folder)
- folder = add(getfolder(1), NULL);
+ folder = getcpy(getcurfol());
if (!(mp = folder_read(folder)))
adios(NULL, "unable to read folder %s", folder);
if (!(mp = folder_read(folder)))
adios(NULL, "unable to read folder %s", folder);
@@
-773,7
+773,7
@@
use_forw:
snprintf(buffer, sizeof(buffer),
"%s/%d", mp->foldpath,
msgnum);
snprintf(buffer, sizeof(buffer),
"%s/%d", mp->foldpath,
msgnum);
- pe->ce_file = add(buffer, NULL);
+ pe->ce_file = getcpy(buffer);
if (listsw && stat(pe->ce_file, &st)
!= NOTOK)
p->c_end = (long) st.st_size;
if (listsw && stat(pe->ce_file, &st)
!= NOTOK)
p->c_end = (long) st.st_size;
@@
-795,7
+795,7
@@
use_forw:
msgnum = mp->lowsel;
snprintf(buffer, sizeof(buffer), "%s/%d",
mp->foldpath, msgnum);
msgnum = mp->lowsel;
snprintf(buffer, sizeof(buffer), "%s/%d",
mp->foldpath, msgnum);
- ce->ce_file = add(buffer, NULL);
+ ce->ce_file = getcpy(buffer);
if (listsw && stat(ce->ce_file, &st) != NOTOK)
ct->c_end = (long) st.st_size;
}
if (listsw && stat(ce->ce_file, &st) != NOTOK)
ct->c_end = (long) st.st_size;
}
@@
-966,7
+966,7
@@
compose_content(CT ct)
CT p = part->mp_part;
sprintf(pp, "%d", partnum);
CT p = part->mp_part;
sprintf(pp, "%d", partnum);
- p->c_partno = add(partnam, NULL);
+ p->c_partno = getcpy(partnam);
if (compose_content(p) == NOTOK)
return NOTOK;
}
if (compose_content(p) == NOTOK)
return NOTOK;
}
@@
-1032,7
+1032,7
@@
compose_content(CT ct)
if (tfile == NULL) {
adios("mhbuildsbr", "unable to create temporary file");
}
if (tfile == NULL) {
adios("mhbuildsbr", "unable to create temporary file");
}
- ce->ce_file = add(tfile, NULL);
+ ce->ce_file = getcpy(tfile);
ce->ce_unlink = 1;
xstdout = 0;
ce->ce_unlink = 1;
xstdout = 0;
@@
-1120,7
+1120,7
@@
raw:
if ((out = fopen(ce->ce_file, "w")) == NULL)
adios(ce->ce_file, "unable to open for writing");
if ((out = fopen(ce->ce_file, "w")) == NULL)
adios(ce->ce_file, "unable to open for writing");
- for (i = 0; (child_id = vfork()) == NOTOK && i > 5; i++)
+ for (i = 0; (child_id = fork()) == NOTOK && i > 5; i++)
sleep(5);
switch (child_id) {
case NOTOK:
sleep(5);
switch (child_id) {
case NOTOK:
@@
-1335,7
+1335,7
@@
scan_content(CT ct)
if (!isspace(*cp))
break;
*++cp = '\0';
if (!isspace(*cp))
break;
*++cp = '\0';
- if (!strncmp(buffer + 2, prefix, len) &&
+ if (strncmp(buffer + 2, prefix, len)==0 &&
isdigit(buffer[2 + len])) {
boundaryclash = 1;
/* no need to keep checking */
isdigit(buffer[2 + len])) {
boundaryclash = 1;
/* no need to keep checking */
@@
-1369,7
+1369,7
@@
scan_content(CT ct)
NULL);
} else {
t->tx_charset = CHARSET_USASCII;
NULL);
} else {
t->tx_charset = CHARSET_USASCII;
- *ap = add("charset=us-ascii", NULL);
+ *ap = getcpy("charset=us-ascii");
}
cp = strchr(*ap++, '=');
}
cp = strchr(*ap++, '=');
@@
-1438,7
+1438,7
@@
build_headers(CT ct)
ep = ci->ci_values;
snprintf(buffer, sizeof(buffer), "boundary=%s%d",
prefix, level++);
ep = ci->ci_values;
snprintf(buffer, sizeof(buffer), "boundary=%s%d",
prefix, level++);
- cp = strchr(*ap++ = add(buffer, NULL), '=');
+ cp = strchr(*ap++ = getcpy(buffer), '=');
*ap = NULL;
*cp++ = '\0';
*ep = cp;
*ap = NULL;
*cp++ = '\0';
*ep = cp;
@@
-1457,7
+1457,7
@@
build_headers(CT ct)
/*
** output the content type and subtype
*/
/*
** output the content type and subtype
*/
- np = add(TYPE_FIELD, NULL);
+ np = getcpy(TYPE_FIELD);
vp = concat(" ", ci->ci_type, "/", ci->ci_subtype, NULL);
/* keep track of length of line */
vp = concat(" ", ci->ci_type, "/", ci->ci_subtype, NULL);
/* keep track of length of line */
@@
-1514,7
+1514,7
@@
build_headers(CT ct)
** output the Content-ID, unless disabled by -nocontentid
*/
if (contentidsw && ct->c_id) {
** output the Content-ID, unless disabled by -nocontentid
*/
if (contentidsw && ct->c_id) {
- np = add(ID_FIELD, NULL);
+ np = getcpy(ID_FIELD);
vp = concat(" ", ct->c_id, NULL);
add_header(ct, np, vp);
}
vp = concat(" ", ct->c_id, NULL);
add_header(ct, np, vp);
}
@@
-1523,7
+1523,7
@@
build_headers(CT ct)
** output the Content-Description
*/
if (ct->c_descr) {
** output the Content-Description
*/
if (ct->c_descr) {
- np = add(DESCR_FIELD, NULL);
+ np = getcpy(DESCR_FIELD);
vp = concat(" ", ct->c_descr, NULL);
add_header(ct, np, vp);
}
vp = concat(" ", ct->c_descr, NULL);
add_header(ct, np, vp);
}
@@
-1532,7
+1532,7
@@
build_headers(CT ct)
** output the Content-Disposition
*/
if (ct->c_dispo) {
** output the Content-Disposition
*/
if (ct->c_dispo) {
- np = add(DISPO_FIELD, NULL);
+ np = getcpy(DISPO_FIELD);
vp = concat(" ", ct->c_dispo, NULL);
add_header(ct, np, vp);
}
vp = concat(" ", ct->c_dispo, NULL);
add_header(ct, np, vp);
}
@@
-1550,7
+1550,7
@@
skip_headers:
** output the Content-MD5
*/
if (checksw) {
** output the Content-MD5
*/
if (checksw) {
- np = add(MD5_FIELD, NULL);
+ np = getcpy(MD5_FIELD);
vp = calculate_digest(ct, (ct->c_encoding == CE_QUOTED) ?
1 : 0);
add_header(ct, np, vp);
vp = calculate_digest(ct, (ct->c_encoding == CE_QUOTED) ?
1 : 0);
add_header(ct, np, vp);
@@
-1563,7
+1563,7
@@
skip_headers:
case CE_7BIT:
/* Nothing to output */
#if 0
case CE_7BIT:
/* Nothing to output */
#if 0
- np = add(ENCODING_FIELD, NULL);
+ np = getcpy(ENCODING_FIELD);
vp = concat(" ", "7bit", "\n", NULL);
add_header(ct, np, vp);
#endif
vp = concat(" ", "7bit", "\n", NULL);
add_header(ct, np, vp);
#endif
@@
-1573,7
+1573,7
@@
skip_headers:
if (ct->c_type == CT_MESSAGE)
adios(NULL, "internal error, invalid encoding");
if (ct->c_type == CT_MESSAGE)
adios(NULL, "internal error, invalid encoding");
- np = add(ENCODING_FIELD, NULL);
+ np = getcpy(ENCODING_FIELD);
vp = concat(" ", "8bit", "\n", NULL);
add_header(ct, np, vp);
break;
vp = concat(" ", "8bit", "\n", NULL);
add_header(ct, np, vp);
break;
@@
-1582,7
+1582,7
@@
skip_headers:
if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART)
adios(NULL, "internal error, invalid encoding");
if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART)
adios(NULL, "internal error, invalid encoding");
- np = add(ENCODING_FIELD, NULL);
+ np = getcpy(ENCODING_FIELD);
vp = concat(" ", "quoted-printable", "\n", NULL);
add_header(ct, np, vp);
break;
vp = concat(" ", "quoted-printable", "\n", NULL);
add_header(ct, np, vp);
break;
@@
-1591,7
+1591,7
@@
skip_headers:
if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART)
adios(NULL, "internal error, invalid encoding");
if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART)
adios(NULL, "internal error, invalid encoding");
- np = add(ENCODING_FIELD, NULL);
+ np = getcpy(ENCODING_FIELD);
vp = concat(" ", "base64", "\n", NULL);
add_header(ct, np, vp);
break;
vp = concat(" ", "base64", "\n", NULL);
add_header(ct, np, vp);
break;
@@
-1600,7
+1600,7
@@
skip_headers:
if (ct->c_type == CT_MESSAGE)
adios(NULL, "internal error, invalid encoding");
if (ct->c_type == CT_MESSAGE)
adios(NULL, "internal error, invalid encoding");
- np = add(ENCODING_FIELD, NULL);
+ np = getcpy(ENCODING_FIELD);
vp = concat(" ", "binary", "\n", NULL);
add_header(ct, np, vp);
break;
vp = concat(" ", "binary", "\n", NULL);
add_header(ct, np, vp);
break;