From c67c38e4cb1110be80927cf11a5ce14d316c4a51 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Mon, 18 Sep 2017 11:56:26 +0100 Subject: [PATCH] whom.c: Don't store atoi(getenv("mhdist")) when value only tested. 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 | 4 ++-- uip/whatnowsbr.c | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/uip/send.c b/uip/send.c index 1f419f57..817feb70 100644 --- a/uip/send.c +++ b/uip/send.c @@ -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) { diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index b02b5e22..c03ceb82 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -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"; -- 2.56.0