]> code.citadel.org Git - citadel.git/blobdiff - citadel/msgbase.c
That didn't work.
[citadel.git] / citadel / msgbase.c
index b809bec20dc4d69f0d4aa36baeee4208d2e5b00f..819913f47a9e87203212d886ab1dff6edfcda623 100644 (file)
@@ -402,11 +402,11 @@ void CtdlSetSeen(long *target_msgnums, int num_target_msgnums,
 #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
 
@@ -551,7 +551,7 @@ int CtdlForEachMessage(int mode, long ref, char *search_string,
        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;
        }
@@ -579,7 +579,7 @@ int CtdlForEachMessage(int mode, long ref, char *search_string,
                /* 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
@@ -1623,7 +1623,6 @@ int CtdlOutputPreLoadedMsg(
        char luser[100];
        char fuser[100];
        char snode[100];
-       char lnode[100];
        char mid[100];
        char datestamp[100];
 
@@ -1783,7 +1782,6 @@ int CtdlOutputPreLoadedMsg(
        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]) {
@@ -1815,8 +1813,6 @@ int CtdlOutputPreLoadedMsg(
                                }
                                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')
@@ -1828,13 +1824,15 @@ int CtdlOutputPreLoadedMsg(
                                {
                                        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') {
@@ -1895,8 +1893,6 @@ int CtdlOutputPreLoadedMsg(
                        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);
@@ -3872,9 +3868,9 @@ void cmd_ent0(char *entargs)
         * 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.