]> diplodocus.org Git - nmh/commitdiff
whom.c: Don't store atoi(getenv("mhdist")) when value only tested.
authorRalph Corderoy <ralph@inputplus.co.uk>
Mon, 18 Sep 2017 10:56:26 +0000 (11:56 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Mon, 18 Sep 2017 12:10:09 +0000 (13:10 +0100)
It's the non-zero value of atoi(3) that's important in the if-condition;
the value is never used again.

uip/send.c
uip/whatnowsbr.c

index 1f419f5..817feb7 100644 (file)
@@ -112,7 +112,7 @@ extern char *distfile;
 int
 main (int argc, char **argv)
 {
-    int msgp = 0, distsw = 0, vecp;
+    int msgp = 0, vecp;
     int isdf = 0, mime = 0;
     int msgnum, status;
     char *cp, *dfolder = NULL, *maildir = NULL;
@@ -397,7 +397,7 @@ go_to_it:
 
     if ((cp = getenv ("mhdist"))
            && *cp
-           && (distsw = atoi (cp))
+           && atoi(cp)
            && altmsg) {
        vec[vecp++] = "-dist";
        if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) {
index b02b5e2..c03ceb8 100644 (file)
@@ -979,10 +979,6 @@ sendit (char *sp, char **arg, char *file, int pushed)
     int snoop = 0;
     struct stat st;
 
-#ifndef        lint
-    int        distsw = 0;
-#endif
-
     /*
      * Make sure these are defined.  In particular, we need
      * savearg[1] to be NULL, in case "arg" is NULL below.  It
@@ -1206,7 +1202,7 @@ sendit (char *sp, char **arg, char *file, int pushed)
     if ((cp = getenv ("mhdist"))
            && *cp
 #ifndef lint
-           && (distsw = atoi (cp))
+           && atoi(cp)
 #endif /* not lint */
            && altmsg) {
        vec[vecp++] = "-dist";