]> diplodocus.org Git - nmh/commitdiff
Fix up warnings reported by LLVM.
authorKen Hornstein <kenh@pobox.com>
Mon, 28 Oct 2013 02:31:35 +0000 (22:31 -0400)
committerKen Hornstein <kenh@pobox.com>
Mon, 28 Oct 2013 02:31:35 +0000 (22:31 -0400)
sbr/addrsbr.c
uip/dropsbr.c
uip/inc.c
uip/mhlistsbr.c
uip/msgchk.c
uip/post.c
uip/scansbr.c

index 231a50415f20294fc8cd9f9b83b79d1915037cff..ce14394ec27df5ba9df38b33a4da1f1dde11ed2f 100644 (file)
@@ -242,10 +242,13 @@ auxformat (struct mailname *mp, int extras)
            strncpy (addr, mp->m_mbox ? mp->m_mbox : "", sizeof(addr));
        else
 
-       if (mp->m_type != UUCPHOST)
-           snprintf (addr, sizeof(addr), mp->m_host ? "%s%s@%s" : "%s%s",
-               empty(mp->m_path), empty(mp->m_mbox), mp->m_host);
-       else
+       if (mp->m_type != UUCPHOST) {
+           if (mp->m_host)
+               snprintf (addr, sizeof(addr), "%s%s@%s", empty(mp->m_path),
+                         empty(mp->m_mbox), mp->m_host);
+           else snprintf (addr, sizeof(addr), "%s%s", empty(mp->m_path),
+                          empty(mp->m_mbox));
+       } else
            snprintf (addr, sizeof(addr), "%s!%s", mp->m_host, mp->m_mbox);
 
     if (!extras)
index 5fcef29ef8fcbd0871dd455e7448aa6cf71c54e0..e97ab626b8e8d3fa99ed817feec9af7ce0452c0b 100644 (file)
@@ -40,7 +40,7 @@ static int map_open (char *, int);
 int
 mbx_open (char *file, int mbx_style, uid_t uid, gid_t gid, mode_t mode)
 {
-    int j, count, fd;
+    int j, count, fd = NOTOK;
     struct stat st;
 
     j = 0;
index cd98ddb8cb943a444599da544131c833599534a3..0e527442d8c7a1a30dfbcdb4b93ca91befec3742 100644 (file)
--- a/uip/inc.c
+++ b/uip/inc.c
@@ -547,10 +547,15 @@ go_to_it:
        else if (i == NOTOK)
            chmod (audfile, m_gmprot ());
 
-       fprintf (aud, from ? "<<inc>> %s -ms %s\n"
-                : host ? "<<inc>> %s -host %s -user %s\n"
-                : "<<inc>> %s\n",
-                dtimenow (0), from ? from : host, user);
+       if (from)
+           fprintf (aud, "<<inc>> %s -ms %s\n", dtimenow(0), from);
+       else {
+           if (host)
+               fprintf (aud, "<<inc>> %s -host %s -user %s\n", dtimenow(0),
+                        host, user);
+           else
+               fprintf (aud, "<<inc>> %s\n", dtimenow (0));
+       }
     }
 
     /* Get new format string */
index 3c36871006bc624223df96dedabf1375f8bd3224..0b4e439f0594d2c227d361f2b3247095e098b7c4 100644 (file)
@@ -159,8 +159,11 @@ list_content (CT ct, int toplevel, int realsize, int verbose, int debug)
     char *cp, buffer[BUFSIZ];
     CI ci = &ct->c_ctinfo;
 
-    printf (toplevel > 0 ? LSTFMT2a : toplevel < 0 ? "part " : "     ",
-           atoi (r1bindex (empty (ct->c_file), '/')));
+    if (toplevel > 0)
+       printf (LSTFMT2a, atoi (r1bindex (empty (ct->c_file), '/')));
+    else
+       printf(toplevel < 0 ? "part " : "     ");
+
     snprintf (buffer, sizeof(buffer), "%s/%s", empty (ci->ci_type),
                empty (ci->ci_subtype));
     printf (LSTFMT2b, empty (ct->c_partno), buffer);
index af280f595bc92a49ecb39812c95409f8b291d3f0..76bb37d8e7be37831fd20f151c112b4b23f9522c 100644 (file)
@@ -285,7 +285,10 @@ checkmail (char *user, char *home, int datesw, int notifysw, int personal)
 
     if ((mf & UUCPOK) || (mf & MMDFOK)) {
        if (notifysw & NT_MAIL) {
-           printf (personal ? "You have " : "%s has ", user);
+           if (personal)
+               printf ("You have ");
+           else
+               printf ("%s has ", user);
            if (mf & UUCPOK)
                printf ("%s old-style bell", mf & UUCPOLD ? "old" : "new");
            if ((mf & UUCPOK) && (mf & MMDFOK))
@@ -340,7 +343,11 @@ remotemail (char *host, char *port, char *user, char *proxy, int notifysw,
 
     if (nmsgs) {
        if (notifysw & NT_MAIL) {
-           printf (personal ? "You have " : "%s has ", user);
+           if (personal)
+               printf ("You have ");
+           else
+               printf ("%s has ", user);
+
            printf ("%d message%s (%d bytes)",
                    nmsgs, nmsgs != 1 ? "s" : "", nbytes);
        }
index aadc6271a00fdf89ffbfdb72824afee91e1d9240..9bbaa5f547766ea8197f0eb6a59fde1709a8e796 100644 (file)
@@ -649,9 +649,13 @@ main (int argc, char **argv)
     p_refile (tmpfil);
     unlink (tmpfil);
 
-    if (verbose)
-       printf (partno ? "Partial Message #%s Processed\n" : "Message Processed\n",
-               partno);
+    if (verbose) {
+       if (partno)
+           printf ("Partial Message #%s Processed\n", partno);
+       else
+           printf ("Message Processed\n");
+    }
+
     done (0);
     return 1;
 }
index c038622e64eae05f8f502a71b3b9e8423b706619..a07889e48b424cced88deee44d9e1b93d0f3e6db 100644 (file)
@@ -277,10 +277,12 @@ body:;
 
            case LENERR: 
            case FMTERR: 
-               fprintf (stderr, 
-                       innum ? "??Format error (message %d) in "
-                             : "??Format error in ",
-                       outnum ? outnum : innum);
+               if (innum)
+                   fprintf (stderr, "??Format error (message %d) in ",
+                            outnum ? outnum : innum);
+               else
+                   fprintf (stderr, "??Format error in ");
+
                fprintf (stderr, "component %d\n", compnum);
 
                if (outnum) {