From: Dan Harkless Date: Fri, 16 Jul 1999 01:11:44 +0000 (+0000) Subject: Eliminated compilation warnings. X-Git-Tag: nmh-1_0~163 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=3c9700d8d045f3ff26ce5dd2a174454dafc14822;p=mmh Eliminated compilation warnings. --- diff --git a/mts/sendmail/hosts.c b/mts/sendmail/hosts.c index 55f3393..7d1d808 100644 --- a/mts/sendmail/hosts.c +++ b/mts/sendmail/hosts.c @@ -55,7 +55,7 @@ OfficialName (char *name) strncpy (buffer, hp->h_name, sizeof(buffer)); return buffer; } - if (hosts.h_name || init_hs ()) + if (hosts.h_name || init_hs ()) { for (h = hosts.h_next; h; h = h->h_next) if (!strcasecmp (h->h_name, q)) return h->h_name; @@ -63,6 +63,7 @@ OfficialName (char *name) for (r = h->h_aliases; *r; r++) if (!strcasecmp (*r, q)) return h->h_name; + } strncpy (buffer, site, sizeof(buffer)); return buffer; diff --git a/mts/sendmail/sendmail.c b/mts/sendmail/sendmail.c index 1ff4138..05f8c33 100644 --- a/mts/sendmail/sendmail.c +++ b/mts/sendmail/sendmail.c @@ -112,11 +112,12 @@ sm_init (char *client, char *server, int watch, int verbose, if (sm_rfp != NULL && sm_wfp != NULL) return RP_OK; - if (client == NULL || *client == '\0') + if (client == NULL || *client == '\0') { if (clientname) client = clientname; else client = LocalName(); /* no clientname -> LocalName */ + } #ifdef ZMAILER if (client == NULL || *client == '\0') diff --git a/sbr/addrsbr.c b/sbr/addrsbr.c index 0e2f0a4..d1fd730 100644 --- a/sbr/addrsbr.c +++ b/sbr/addrsbr.c @@ -285,7 +285,7 @@ auxformat (struct mailname *mp, int extras) if (!extras) return addr; - if (mp->m_pers || mp->m_path) + if (mp->m_pers || mp->m_path) { if (mp->m_note) snprintf (buffer, sizeof(buffer), "%s %s <%s>", legal_person (mp->m_pers ? mp->m_pers : mp->m_mbox), @@ -294,6 +294,7 @@ auxformat (struct mailname *mp, int extras) snprintf (buffer, sizeof(buffer), "%s <%s>", legal_person (mp->m_pers ? mp->m_pers : mp->m_mbox), addr); + } else if (mp->m_note) snprintf (buffer, sizeof(buffer), "%s %s", addr, mp->m_note); diff --git a/sbr/fmt_addr.c b/sbr/fmt_addr.c index 782eb0a..150aa73 100644 --- a/sbr/fmt_addr.c +++ b/sbr/fmt_addr.c @@ -82,7 +82,7 @@ formataddr (char *orig, char *str) } /* concatenate all the new addresses onto 'buf' */ - for (isgroup = 0; cp = getname (str); ) { + for (isgroup = 0; (cp = getname (str)); ) { if ((mp = getm (cp, NULL, 0, fmt_norm, NULL)) == NULL) continue; diff --git a/sbr/fmt_scan.c b/sbr/fmt_scan.c index 630cfc5..0af69ab 100644 --- a/sbr/fmt_scan.c +++ b/sbr/fmt_scan.c @@ -234,7 +234,7 @@ get_x400_friendly (char *mbox, char *buffer, int buffer_len) return NULL; if (get_x400_comp (mbox, "/PN=", buffer, buffer_len)) { - for (mbox = buffer; mbox = strchr(mbox, '.'); ) + for (mbox = buffer; (mbox = strchr(mbox, '.')); ) *mbox++ = ' '; return buffer; @@ -636,7 +636,7 @@ fmt_scan (struct format *format, char *scanl, int width, int *dat) } if (fmt->f_type == FT_LS_ADDR) goto unfriendly; - if ((str = mn->m_pers) == NULL) + if ((str = mn->m_pers) == NULL) { if ((str = mn->m_note)) { strncpy (buffer, str, sizeof(buffer)); str = buffer; @@ -674,6 +674,7 @@ fmt_scan (struct format *format, char *scanl, int width, int *dat) break; } } + } break; case FT_LOCALDATE: diff --git a/uip/aliasbr.c b/uip/aliasbr.c index 8ea8c13..b15865e 100644 --- a/uip/aliasbr.c +++ b/uip/aliasbr.c @@ -450,11 +450,12 @@ getalias (char *addrs) if (*qp == ',') *qp++ = 0; for (cp = qp, qp--; qp > pp; qp--) - if (*qp != 0) + if (*qp != 0) { if (isspace (*qp)) *qp = 0; else break; + } return pp; } diff --git a/uip/mhbuild.c b/uip/mhbuild.c index bacec10..dc0059c 100644 --- a/uip/mhbuild.c +++ b/uip/mhbuild.c @@ -363,12 +363,11 @@ main (int argc, char **argv) unlink_outfile = 0; free_content (ct); - done (0); - /* NOT REACHED */ + return done (0); } -void +int done (int status) { /* @@ -381,4 +380,5 @@ done (int status) unlink (outfile); exit (status); + return 1; /* dead code to satisfy the compiler */ } diff --git a/uip/mhlist.c b/uip/mhlist.c index d5f2908..ec2f945 100644 --- a/uip/mhlist.c +++ b/uip/mhlist.c @@ -395,8 +395,7 @@ do_cache: context_save (); /* save the context file */ } - done (0); - /* NOTREACHED */ + return done (0); } @@ -415,7 +414,7 @@ pipeser (int i) } -void +int done (int status) { CT *ctp; @@ -425,4 +424,5 @@ done (int status) free_content (*ctp); exit (status); + return 1; /* dead code to satisfy the compiler */ } diff --git a/uip/mhn.c b/uip/mhn.c index 70f730b..f73853e 100644 --- a/uip/mhn.c +++ b/uip/mhn.c @@ -708,8 +708,7 @@ do_cache: context_save (); /* save the context file */ } - done (0); - /* NOTREACHED */ + return done (0); } @@ -728,7 +727,7 @@ pipeser (int i) } -void +int done (int status) { CT *ctp; @@ -738,4 +737,5 @@ done (int status) free_content (*ctp); exit (status); + return 1; /* dead code to satisfy the compiler */ } diff --git a/uip/mhparam.c b/uip/mhparam.c index 1da25d3..f6ebb65 100644 --- a/uip/mhparam.c +++ b/uip/mhparam.c @@ -177,7 +177,7 @@ main(int argc, char **argv) } } - done (missed); + return done (missed); } diff --git a/uip/mhpath.c b/uip/mhpath.c index ac1854e..918371a 100644 --- a/uip/mhpath.c +++ b/uip/mhpath.c @@ -144,5 +144,5 @@ main(int argc, char **argv) seq_save (mp); /* synchronize message sequences */ context_save (); /* save the context file */ folder_free (mp); /* free folder/message structure */ - done (0); + return done (0); } diff --git a/uip/mhshow.c b/uip/mhshow.c index ff2bee8..0791c48 100644 --- a/uip/mhshow.c +++ b/uip/mhshow.c @@ -475,8 +475,7 @@ do_cache: context_save (); /* save the context file */ } - done (0); - /* NOTREACHED */ + return done (0); } @@ -495,7 +494,7 @@ pipeser (int i) } -void +int done (int status) { CT *ctp; @@ -505,4 +504,5 @@ done (int status) free_content (*ctp); exit (status); + return 1; /* dead code to satisfy the compiler */ } diff --git a/uip/mhstore.c b/uip/mhstore.c index a52e00b..c9b6a26 100644 --- a/uip/mhstore.c +++ b/uip/mhstore.c @@ -407,8 +407,7 @@ do_cache: context_save (); /* save the context file */ } - done (0); - /* NOTREACHED */ + return done (0); } @@ -427,7 +426,7 @@ pipeser (int i) } -void +int done (int status) { CT *ctp; @@ -437,4 +436,5 @@ done (int status) free_content (*ctp); exit (status); + return 1; /* dead code to satisfy the compiler */ } diff --git a/uip/mhtest.c b/uip/mhtest.c index 80a0c7b..5c03109 100644 --- a/uip/mhtest.c +++ b/uip/mhtest.c @@ -386,8 +386,7 @@ do_cache: context_save (); /* save the context file */ } - done (0); - /* NOTREACHED */ + return done (0); } @@ -421,7 +420,7 @@ pipeser (int i) } -void +int done (int status) { CT *ctp; @@ -431,4 +430,5 @@ done (int status) free_content (*ctp); exit (status); + return 1; /* dead code to satisfy the compiler */ } diff --git a/uip/packf.c b/uip/packf.c index ec2f975..a607da8 100644 --- a/uip/packf.c +++ b/uip/packf.c @@ -197,12 +197,13 @@ main (int argc, char **argv) seq_save (mp); context_save (); /* save the context file */ folder_free (mp); /* free folder/message structure */ - done (0); + return done (0); } -void +int done (int status) { mbx_close (file, md); exit (status); + return 1; /* dead code to satisfy the compiler */ } diff --git a/uip/pick.c b/uip/pick.c index d2f72ef..fb34285 100644 --- a/uip/pick.c +++ b/uip/pick.c @@ -303,14 +303,15 @@ main (int argc, char **argv) seq_save (mp); /* synchronize message sequences */ context_save (); /* save the context file */ folder_free (mp); /* free folder/message structure */ - done (0); + return done (0); } -void +int done (int status) { if (listsw && status && !isatty (fileno (stdout))) printf ("0\n"); exit (status); + return 1; /* dead code to satisfy the compiler */ } diff --git a/uip/popi.c b/uip/popi.c index 59ab61a..a48c223 100644 --- a/uip/popi.c +++ b/uip/popi.c @@ -255,9 +255,7 @@ main (int argc, char **argv) seq_setunseen (mp, 0); /* set the Unseen-Sequence */ seq_save (mp); context_save (); /* save the context file */ - done (0); - - /* NOTREACHED */ + return done (0); } diff --git a/uip/prompter.c b/uip/prompter.c index fa1bfae..e1f0e8d 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -397,7 +397,7 @@ no_body: unlink (tmpfil); context_save (); /* save the context file */ - done (0); + return done (0); } diff --git a/uip/rcvpack.c b/uip/rcvpack.c index 1520cbe..f9834be 100644 --- a/uip/rcvpack.c +++ b/uip/rcvpack.c @@ -99,5 +99,5 @@ main (int argc, char **argv) if (mbx_close (file, md) == NOTOK) done (RCV_MBX); - done (RCV_MOK); + return done (RCV_MOK); } diff --git a/uip/rcvstore.c b/uip/rcvstore.c index 81a03e8..5a3dcbe 100644 --- a/uip/rcvstore.c +++ b/uip/rcvstore.c @@ -218,16 +218,17 @@ main (int argc, char **argv) unlink (tmpfilenam); /* remove temporary file */ tmpfilenam = NULL; - done (0); + return done (0); } /* * Clean up and exit */ -void +int done(int status) { if (tmpfilenam && *tmpfilenam) unlink (tmpfilenam); exit (status); + return 1; /* dead code to satisfy the compiler */ } diff --git a/uip/refile.c b/uip/refile.c index 83e5639..906ea4a 100644 --- a/uip/refile.c +++ b/uip/refile.c @@ -280,7 +280,7 @@ main (int argc, char **argv) context_replace (pfolder, folder); /* update current folder */ context_save (); /* save the context file */ folder_free (mp); /* free folder structure */ - done (0); + return done (0); } diff --git a/uip/repl.c b/uip/repl.c index af58c59..67155fa 100644 --- a/uip/repl.c +++ b/uip/repl.c @@ -430,7 +430,7 @@ try_it_again: done (0); what_now (ed, nedit, NOUSE, drft, msg, 0, mp, anot ? "Replied" : NULL, inplace, cwd); - done (1); + return done (1); } void diff --git a/uip/rmf.c b/uip/rmf.c index 059e607..9b12304 100644 --- a/uip/rmf.c +++ b/uip/rmf.c @@ -115,7 +115,7 @@ main (int argc, char **argv) context_replace (pfolder, newfolder); /* update current folder */ } context_save (); /* save the context file */ - done (0); + return done (0); } static int diff --git a/uip/rmm.c b/uip/rmm.c index 1b09907..21a0f90 100644 --- a/uip/rmm.c +++ b/uip/rmm.c @@ -147,5 +147,5 @@ main (int argc, char **argv) context_replace (pfolder, folder); /* update current folder */ context_save (); /* save the context file */ folder_free (mp); /* free folder structure */ - done (0); + return done (0); } diff --git a/uip/scan.c b/uip/scan.c index 1f9b8c0..cbd9277 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -347,5 +347,5 @@ main (int argc, char **argv) if (clearflag) clear_screen (); - done (0); + return done (0); } diff --git a/uip/send.c b/uip/send.c index 2370ea4..b98d89a 100644 --- a/uip/send.c +++ b/uip/send.c @@ -428,5 +428,5 @@ go_to_it: } context_save (); /* save the context file */ - done (status); + return done (status); } diff --git a/uip/sendsbr.c b/uip/sendsbr.c index 245a538..b7c4cf2 100644 --- a/uip/sendsbr.c +++ b/uip/sendsbr.c @@ -31,7 +31,7 @@ static jmp_buf env; * external prototypes */ int sendsbr (char **, int, char *, struct stat *, int); -void done (int); +int done (int); char *getusername (void); /* @@ -640,11 +640,12 @@ oops: } -void +int done (int status) { if (armed) longjmp (env, status ? status : NOTOK); exit (status); + return 1; /* dead code to satisfy the compiler */ } diff --git a/uip/show.c b/uip/show.c index 75e4827..7927ac5 100644 --- a/uip/show.c +++ b/uip/show.c @@ -353,6 +353,7 @@ go_to_it: ; vec[0] = r1bindex (proc, '/'); execvp (proc, vec); adios (proc, "unable to exec"); + return 0; /* dead code to satisfy the compiler */ } /* diff --git a/uip/termsbr.c b/uip/termsbr.c index 77af468..28aaa8f 100644 --- a/uip/termsbr.c +++ b/uip/termsbr.c @@ -170,7 +170,7 @@ sc_length (void) static int outc (int c) { - putchar(c); + return putchar(c); } diff --git a/uip/vmh.c b/uip/vmh.c index 8b398e6..b64bdab 100644 --- a/uip/vmh.c +++ b/uip/vmh.c @@ -278,7 +278,7 @@ main (int argc, char **argv) vmh (); - done (0); + return done (0); } @@ -1432,13 +1432,14 @@ TSTPser (int sig) /* MISCELLANY */ -void +int done (int status) { TTYoff (); pFIN (); exit (status); + return 1; /* dead code to satisfy the compiler */ } diff --git a/uip/vmhtest.c b/uip/vmhtest.c index 813e6b7..46ecf8c 100644 --- a/uip/vmhtest.c +++ b/uip/vmhtest.c @@ -88,7 +88,7 @@ main (int argc, char **argv) pINI (); pLOOP (); - done (0); + return done (0); } diff --git a/uip/whatnow.c b/uip/whatnow.c index 083650e..34c560e 100644 --- a/uip/whatnow.c +++ b/uip/whatnow.c @@ -14,5 +14,5 @@ main (int argc, char **argv) #ifdef LOCALE setlocale(LC_ALL, ""); #endif - WhatNow (argc, argv); + return WhatNow (argc, argv); } diff --git a/uip/whatnowsbr.c b/uip/whatnowsbr.c index b12307d..854a972 100644 --- a/uip/whatnowsbr.c +++ b/uip/whatnowsbr.c @@ -363,13 +363,14 @@ editfile (char **ed, char **arg, char *file, int use, struct msgs *mp, else { #endif if (((status & 0xff00) != 0xff00) - && (!reedit || (status & 0x00ff))) + && (!reedit || (status & 0x00ff))) { if (!use && (status & 0xff00) && (rename (file, cp = m_backup (file)) != NOTOK)) { advise (NULL, "problems with edit--draft left in %s", cp); } else { advise (NULL, "problems with edit--%s preserved", file); } + } status = -2; /* maybe "reedit ? -2 : -1"? */ break; #ifdef ATTVIBUG diff --git a/uip/whom.c b/uip/whom.c index aeb8d3b..5a82534 100644 --- a/uip/whom.c +++ b/uip/whom.c @@ -185,5 +185,5 @@ main (int argc, char **argv) done (status); } - exit (-1); /* NOT REACHED */ + return 0; /* dead code to satisfy the compiler */ } diff --git a/uip/wmh.c b/uip/wmh.c index fce1f59..2e46dbb 100644 --- a/uip/wmh.c +++ b/uip/wmh.c @@ -200,7 +200,7 @@ main (int argc, char **argv) vmh (); - done (0); + return done (0); } @@ -1285,7 +1285,7 @@ SIGser (int sig) } -void +int done (int status) { if (dfd != NOTOK) @@ -1294,6 +1294,7 @@ done (int status) pFIN (); exit (status); + return 1; /* dead code to satisfy the compiler */ } diff --git a/zotnet/bboards/getbbent.c b/zotnet/bboards/getbbent.c index b9904be..5f8e88b 100644 --- a/zotnet/bboards/getbbent.c +++ b/zotnet/bboards/getbbent.c @@ -393,11 +393,12 @@ BBread (void) r = strchr(bb->bb_addr, '@'); BBRequest[0] = 0; - if (*bb->bb_request == '-') + if (*bb->bb_request == '-') { if (p == NULL && r && *r == '@') snprintf (BBRequest, sizeof(BBRequest), "%s%s%s", bb->bb_name, bb->bb_request, r); else snprintf (BBRequest, sizeof(BBRequest), "%s%s", bb->bb_name, bb->bb_request); + } else if (p == NULL && r && *r == '@' && *bb->bb_request) snprintf (BBRequest, sizeof(BBRequest), "%s%s", bb->bb_request, r); diff --git a/zotnet/mf/mf.c b/zotnet/mf/mf.c index b129785..d1db19f 100644 --- a/zotnet/mf/mf.c +++ b/zotnet/mf/mf.c @@ -163,7 +163,7 @@ uucpadrx (char *addrs) return NULL; } - if ((wp = strchr(cp, ',')) == NULL) + if ((wp = strchr(cp, ',')) == NULL) { if ((wp = strchr(cp, ' ')) != NULL) { xp = wp; while (isspace (*xp)) @@ -172,11 +172,12 @@ uucpadrx (char *addrs) yp = xp + 4; while (isspace (*yp)) yp++; - if (*yp != 0) + if (*yp != 0) { if ((zp = strchr(yp, ' ')) != NULL) *zp = 0, tp = ++zp; else tp = NULL; + } else *wp = 0, tp = ++wp; } @@ -185,6 +186,7 @@ uucpadrx (char *addrs) } else tp = NULL; + } else *wp = 0, tp = ++wp; @@ -951,7 +953,7 @@ mfgets (FILE *in, char **bp) *cp++ = i; break; } - if (cp >= ep) + if (cp >= ep) { if (!(dp = realloc (pp, (size_t) (len += BUFSIZ)))) { free (pp); pp = NULL; @@ -959,5 +961,6 @@ mfgets (FILE *in, char **bp) } else cp += dp - pp, ep = (pp = cp) + len - 2; + } } }