#if 0 /* This is a special diagnostic section. Do not allow it to run during normal operation. */
CtdlLogPrintf(CTDL_DEBUG, "There are %d messages in the room.\n", num_msgs);
for (i=0; i<num_msgs; ++i) {
- if (i > 0) if (msglist[i] <= msglist[i-1]) abort();
+ if ((i > 0) && (msglist[i] <= msglist[i-1])) abort();
}
CtdlLogPrintf(CTDL_DEBUG, "We are twiddling %d of them.\n", num_target_msgnums);
for (k=0; k<num_target_msgnums; ++k) {
- if (k > 0) if (target_msgnums[k] <= target_msgnums[k-1]) abort();
+ if ((k > 0) && (target_msgnums[k] <= target_msgnums[k-1])) abort();
}
#endif
int need_to_free_re = 0;
regmatch_t pm;
- if (content_type) if (!IsEmptyStr(content_type)) {
+ if ((content_type) && (!IsEmptyStr(content_type))) {
regcomp(&re, content_type, 0);
need_to_free_re = 1;
}
/* If the caller is looking for a specific MIME type, filter
* out all messages which are not of the type requested.
*/
- if (content_type != NULL) if (!IsEmptyStr(content_type)) {
+ if ((content_type != NULL) && (!IsEmptyStr(content_type))) {
/* This call to GetMetaData() sits inside this loop
* so that we only do the extra database read per msg
char luser[100];
char fuser[100];
char snode[100];
- char lnode[100];
char mid[100];
char datestamp[100];
strcpy(luser, "");
strcpy(fuser, "");
strcpy(snode, NODENAME);
- strcpy(lnode, HUMANNODE);
if (mode == MT_RFC822) {
for (i = 0; i < 256; ++i) {
if (TheMessage->cm_fields[i]) {
}
else if (i == 'I')
safestrncpy(mid, mptr, sizeof mid);
- else if (i == 'H')
- safestrncpy(lnode, mptr, sizeof lnode);
else if (i == 'F')
safestrncpy(fuser, mptr, sizeof fuser);
/* else if (i == 'O')
{
if (haschar(mptr, '@') == 0)
{
- cprintf("To: %s@%s%s", mptr, config.c_fqdn, nl);
+ cprintf("To: %s@%s", mptr, config.c_fqdn);
+ cprintf("%s", nl);
}
else
{
if ((flags & QP_EADDR) != 0)
mptr = qp_encode_email_addrs(mptr);
- cprintf("To: %s%s", mptr, nl);
+ cprintf("To: %s", mptr);
+ cprintf("%s", nl);
}
}
else if (i == 'T') {
cprintf("From: \"%s\" <%s@%s>%s", luser, suser, snode, nl);
}
- cprintf("Organization: %s%s", lnode, nl);
-
/* Blank line signifying RFC822 end-of-headers */
if (TheMessage->cm_format_type != FMT_RFC822) {
cprintf("%s", nl);
* is set, or if there is one or more Internet email recipients.
*/
if (CC->room.QRflags2 & QR2_SUBJECTREQ) subject_required = 1;
- if (valid_to) if (valid_to->num_internet > 0) subject_required = 1;
- if (valid_cc) if (valid_cc->num_internet > 0) subject_required = 1;
- if (valid_bcc) if (valid_bcc->num_internet > 0) subject_required = 1;
+ if ((valid_to) && (valid_to->num_internet > 0)) subject_required = 1;
+ if ((valid_cc) && (valid_cc->num_internet > 0)) subject_required = 1;
+ if ((valid_bcc) && (valid_bcc->num_internet > 0)) subject_required = 1;
/* If we're only checking the validity of the request, return
* success without creating the message.