Explicit checks for return values of strcmp().
[mmh] / uip / dropsbr.c
index cc668cd..8681277 100644 (file)
@@ -156,7 +156,7 @@ mbx_chk_mmdf(int fd)
 
        ldelim[count] = 0;
 
-       if (strcmp(ldelim, mmdlm2) && write(fd, "\n", 1) != 1
+       if (strcmp(ldelim, mmdlm2)!=0 && write(fd, "\n", 1) != 1
                        && write(fd, mmdlm2, count) != count)
                return NOTOK;
 
@@ -361,7 +361,7 @@ mbx_copy(char *mailbox, int mbx_style, int md, int fd, int mapping,
                                ** Change the "Return-Path:" field
                                ** (if in first line) back to "From ".
                                */
-                               if (!strncmp(buffer, "Return-Path:", 12)) {
+                               if (strncmp(buffer, "Return-Path:", 12)==0) {
                                        char tmpbuffer[BUFSIZ];
                                        char *tp, *ep, *fp;
 
@@ -372,8 +372,8 @@ mbx_copy(char *mailbox, int mbx_style, int md, int fd, int mapping,
                                                fp = strchr(ep + 1, '\n');
                                        tp = dctime(dlocaltimenow());
                                                snprintf(buffer, sizeof(buffer), "From %.*s  %s", (int)(fp - ep), ep, tp);
-                               } else if (!strncmp(buffer, "X-Envelope-From:",
-                                               16)) {
+                               } else if (strncmp(buffer, "X-Envelope-From:",
+                                               16)==0) {
                                        /*
                                        ** Change the "X-Envelope-From:"
                                        ** field (if first line) back
@@ -387,7 +387,7 @@ mbx_copy(char *mailbox, int mbx_style, int md, int fd, int mapping,
                                        ep = tmpbuffer + 17;
                                        snprintf(buffer, sizeof(buffer),
                                                        "From %s", ep);
-                               } else if (strncmp(buffer, "From ", 5)) {
+                               } else if (strncmp(buffer, "From ", 5)!=0) {
                                        /*
                                        ** If there is already a "From "
                                        ** line, then leave it alone.