From: Ken Hornstein Date: Mon, 28 Oct 2013 02:31:35 +0000 (-0400) Subject: Fix up warnings reported by LLVM. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/acd8a635510ea87b8940c13c5c664a0fc18ebae1?ds=sidebyside;hp=-c Fix up warnings reported by LLVM. --- acd8a635510ea87b8940c13c5c664a0fc18ebae1 diff --git a/sbr/addrsbr.c b/sbr/addrsbr.c index 231a5041..ce14394e 100644 --- a/sbr/addrsbr.c +++ b/sbr/addrsbr.c @@ -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) diff --git a/uip/dropsbr.c b/uip/dropsbr.c index 5fcef29e..e97ab626 100644 --- a/uip/dropsbr.c +++ b/uip/dropsbr.c @@ -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; diff --git a/uip/inc.c b/uip/inc.c index cd98ddb8..0e527442 100644 --- 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 ? "<> %s -ms %s\n" - : host ? "<> %s -host %s -user %s\n" - : "<> %s\n", - dtimenow (0), from ? from : host, user); + if (from) + fprintf (aud, "<> %s -ms %s\n", dtimenow(0), from); + else { + if (host) + fprintf (aud, "<> %s -host %s -user %s\n", dtimenow(0), + host, user); + else + fprintf (aud, "<> %s\n", dtimenow (0)); + } } /* Get new format string */ diff --git a/uip/mhlistsbr.c b/uip/mhlistsbr.c index 3c368710..0b4e439f 100644 --- a/uip/mhlistsbr.c +++ b/uip/mhlistsbr.c @@ -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); diff --git a/uip/msgchk.c b/uip/msgchk.c index af280f59..76bb37d8 100644 --- a/uip/msgchk.c +++ b/uip/msgchk.c @@ -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); } diff --git a/uip/post.c b/uip/post.c index aadc6271..9bbaa5f5 100644 --- a/uip/post.c +++ b/uip/post.c @@ -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; } diff --git a/uip/scansbr.c b/uip/scansbr.c index c038622e..a07889e4 100644 --- a/uip/scansbr.c +++ b/uip/scansbr.c @@ -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) {