diff options
author | brian <brian@cvs.openbsd.org> | 1998-03-13 01:26:04 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 1998-03-13 01:26:04 +0000 |
commit | a269272d6693c9b2f0ab3fada4244139c07ac58f (patch) | |
tree | ed43445c015935ffb99be5dcdac994f41a2730b4 | |
parent | 8c687b21c105bcc201351349f6262a3aa8db5935 (diff) |
Add extraneous braces to stiffle warnings from gcc-2.8
-rw-r--r-- | usr.sbin/ppp/auth.c | 5 | ||||
-rw-r--r-- | usr.sbin/ppp/chap.c | 5 | ||||
-rw-r--r-- | usr.sbin/ppp/command.c | 27 | ||||
-rw-r--r-- | usr.sbin/ppp/deflate.c | 5 | ||||
-rw-r--r-- | usr.sbin/ppp/hdlc.c | 5 | ||||
-rw-r--r-- | usr.sbin/ppp/ip.c | 5 | ||||
-rw-r--r-- | usr.sbin/ppp/modem.c | 5 | ||||
-rw-r--r-- | usr.sbin/ppp/pap.c | 5 | ||||
-rw-r--r-- | usr.sbin/ppp/route.c | 17 |
9 files changed, 45 insertions, 34 deletions
diff --git a/usr.sbin/ppp/auth.c b/usr.sbin/ppp/auth.c index 8c6d78676c7..ef327941a82 100644 --- a/usr.sbin/ppp/auth.c +++ b/usr.sbin/ppp/auth.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: auth.c,v 1.4 1998/01/21 02:13:29 brian Exp $ + * $Id: auth.c,v 1.5 1998/03/13 01:25:50 brian Exp $ * * TODO: * o Implement check against with registered IP addresses. @@ -160,11 +160,12 @@ AuthGetSecret(const char *fname, const char *system, int len, int setaddr) if (setaddr) { memset(&DefHisAddress, '\0', sizeof DefHisAddress); } - if (n > 2 && setaddr) + if (n > 2 && setaddr) { if (UseHisaddr(vector[2], 1)) IpcpInit(); else return NULL; + } if (n > 3) SetLabel(vector[3]); return (passwd); diff --git a/usr.sbin/ppp/chap.c b/usr.sbin/ppp/chap.c index 2e5c9c62df9..257d32d59da 100644 --- a/usr.sbin/ppp/chap.c +++ b/usr.sbin/ppp/chap.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: chap.c,v 1.4 1998/02/19 02:02:45 brian Exp $ + * $Id: chap.c,v 1.5 1998/03/13 01:25:52 brian Exp $ * * TODO: */ @@ -225,7 +225,7 @@ RecvChapTalk(struct fsmheader *chp, struct mbuf *bp) */ if (memcmp(cp, cdigest, 16) == 0) { ChapOutput(CHAP_SUCCESS, chp->id, "Welcome!!", 10); - if ((mode & MODE_DIRECT) && isatty(modem) && Enabled(ConfUtmp)) + if ((mode & MODE_DIRECT) && isatty(modem) && Enabled(ConfUtmp)) { if (Utmp) LogPrintf(LogERROR, "Oops, already logged in on %s\n", VarBaseDevice); @@ -238,6 +238,7 @@ RecvChapTalk(struct fsmheader *chp, struct mbuf *bp) ID0login(&ut); Utmp = 1; } + } NewPhase(PHASE_NETWORK); break; } diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index 5d061b4ce21..ab5a1ac93e1 100644 --- a/usr.sbin/ppp/command.c +++ b/usr.sbin/ppp/command.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: command.c,v 1.27 1998/03/12 02:40:40 brian Exp $ + * $Id: command.c,v 1.28 1998/03/13 01:25:54 brian Exp $ * */ #include <sys/param.h> @@ -210,15 +210,15 @@ DialCommand(struct cmdargs const *arg) static int SetLoopback(struct cmdargs const *arg) { - if (arg->argc == 1) + if (arg->argc == 1) { if (!strcasecmp(*arg->argv, "on")) { VarLoopback = 1; return 0; - } - else if (!strcasecmp(*arg->argv, "off")) { + } else if (!strcasecmp(*arg->argv, "off")) { VarLoopback = 0; return 0; } + } return -1; } @@ -249,7 +249,7 @@ ShellCommand(struct cmdargs const *arg, int bg) } #endif - if (arg->argc == 0) + if (arg->argc == 0) { if (!(mode & MODE_INTER)) { if (VarTerm) LogPrintf(LogWARN, "Can't start an interactive shell from" @@ -263,6 +263,8 @@ ShellCommand(struct cmdargs const *arg, int bg) " the foreground mode\n"); return 1; } + } + if ((shell = getenv("SHELL")) == 0) shell = _PATH_BSHELL; @@ -533,11 +535,12 @@ ShowInitialMRU(struct cmdargs const *arg) static int ShowPreferredMTU(struct cmdargs const *arg) { - if (VarTerm) + if (VarTerm) { if (VarPrefMTU) fprintf(VarTerm, " Preferred MTU: %d\n", VarPrefMTU); else fprintf(VarTerm, " Preferred MTU: unspecified\n"); + } return 0; } @@ -1001,7 +1004,7 @@ SetServer(struct cmdargs const *arg) /* What's what ? */ port = arg->argv[0]; - if (arg->argc == 2) + if (arg->argc == 2) { if (ismask(arg->argv[1])) { passwd = NULL; mask = arg->argv[1]; @@ -1009,7 +1012,7 @@ SetServer(struct cmdargs const *arg) passwd = arg->argv[1]; mask = NULL; } - else if (arg->argc == 3) { + } else if (arg->argc == 3) { passwd = arg->argv[1]; mask = arg->argv[2]; if (!ismask(mask)) @@ -1513,14 +1516,14 @@ AddCommand(struct cmdargs const *arg) if (arg->argc != 3 && arg->argc != 2) return -1; - if (arg->argc == 2) + if (arg->argc == 2) { if (strcasecmp(arg->argv[0], "default")) return -1; else { dest.s_addr = netmask.s_addr = INADDR_ANY; gw = 1; } - else { + } else { if (strcasecmp(arg->argv[0], "MYADDR") == 0) dest = IpcpInfo.want_ipaddr; else if (strcasecmp(arg->argv[0], "HISADDR") == 0) @@ -1545,7 +1548,7 @@ DeleteCommand(struct cmdargs const *arg) { struct in_addr dest, none; - if (arg->argc == 1) + if (arg->argc == 1) { if(strcasecmp(arg->argv[0], "all") == 0) DeleteIfRoutes(0); else { @@ -1558,7 +1561,7 @@ DeleteCommand(struct cmdargs const *arg) none.s_addr = INADDR_ANY; OsSetRoute(RTM_DELETE, dest, none, none, arg->data ? 1 : 0); } - else + } else return -1; return 0; diff --git a/usr.sbin/ppp/deflate.c b/usr.sbin/ppp/deflate.c index 6973cdbddab..24f9ee1aeba 100644 --- a/usr.sbin/ppp/deflate.c +++ b/usr.sbin/ppp/deflate.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: deflate.c,v 1.5 1998/01/10 01:55:14 brian Exp $ + * $Id: deflate.c,v 1.6 1998/03/13 01:25:55 brian Exp $ */ #include <sys/param.h> @@ -277,7 +277,7 @@ DeflateInput(u_short *proto, struct mbuf *mi) flush = Z_SYNC_FLUSH; } - if (InputState.cx.avail_out == 0) + if (InputState.cx.avail_out == 0) { /* overflow */ if (first) { if (!(wp[1] & 1)) { @@ -295,6 +295,7 @@ DeflateInput(u_short *proto, struct mbuf *mi) InputState.cx.next_out = MBUF_CTOP(mo); InputState.cx.avail_out = DEFLATE_CHUNK_LEN; } + } } if (mi != NULL) diff --git a/usr.sbin/ppp/hdlc.c b/usr.sbin/ppp/hdlc.c index b11596e4352..df8d4e1debd 100644 --- a/usr.sbin/ppp/hdlc.c +++ b/usr.sbin/ppp/hdlc.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: hdlc.c,v 1.8 1998/03/12 02:40:41 brian Exp $ + * $Id: hdlc.c,v 1.9 1998/03/13 01:25:57 brian Exp $ * * TODO: */ @@ -389,12 +389,13 @@ DecodePacket(u_short proto, struct mbuf * bp) * If proto isn't PROTO_COMPD, we still want to pass it to the * decompression routines so that the dictionary's updated */ - if (CcpFsm.state == ST_OPENED) + if (CcpFsm.state == ST_OPENED) { if (proto == PROTO_COMPD) { if ((bp = CompdInput(&proto, bp)) == NULL) return; } else if ((proto & 0xfff1) == 0x21) /* Network Layer protocol */ CcpDictSetup(proto, bp); + } switch (proto) { case PROTO_LCP: diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c index b686f4a5bf8..66deccaecc1 100644 --- a/usr.sbin/ppp/ip.c +++ b/usr.sbin/ppp/ip.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: ip.c,v 1.7 1998/01/21 02:13:33 brian Exp $ + * $Id: ip.c,v 1.8 1998/03/13 01:25:58 brian Exp $ * * TODO: * o Return ICMP message for filterd packet @@ -473,11 +473,12 @@ IpInput(struct mbuf * bp) IpcpAddInOctets(nb); nb += sizeof tun - sizeof tun.data; nw = write(tun_out, &tun, nb); - if (nw != nb) + if (nw != nb) { if (nw == -1) LogPrintf(LogERROR, "IpInput: wrote %d, got %s\n", nb, strerror(errno)); else LogPrintf(LogERROR, "IpInput: wrote %d, got %d\n", nb, nw); + } } pfree(bp); diff --git a/usr.sbin/ppp/modem.c b/usr.sbin/ppp/modem.c index b43f66d8fb8..59c5f6bcf82 100644 --- a/usr.sbin/ppp/modem.c +++ b/usr.sbin/ppp/modem.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: modem.c,v 1.13 1998/03/06 00:30:40 brian Exp $ + * $Id: modem.c,v 1.14 1998/03/13 01:26:00 brian Exp $ * * TODO: */ @@ -918,11 +918,12 @@ ShowModemStatus(struct cmdargs const *arg) fprintf(VarTerm, "fd = %d, modem control = %o\n", modem, mbits); fprintf(VarTerm, "connect count: %d\n", connect_count); #ifdef TIOCOUTQ - if (modem >= 0) + if (modem >= 0) { if (ioctl(modem, TIOCOUTQ, &nb) >= 0) fprintf(VarTerm, "outq: %d\n", nb); else fprintf(VarTerm, "outq: ioctl probe failed: %s\n", strerror(errno)); + } #endif fprintf(VarTerm, "outqlen: %d\n", ModemQlen()); fprintf(VarTerm, "DialScript = %s\n", VarDialScript); diff --git a/usr.sbin/ppp/pap.c b/usr.sbin/ppp/pap.c index e2e9c2f78b2..c89849136c6 100644 --- a/usr.sbin/ppp/pap.c +++ b/usr.sbin/ppp/pap.c @@ -18,7 +18,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: pap.c,v 1.3 1998/02/19 02:02:48 brian Exp $ + * $Id: pap.c,v 1.4 1998/03/13 01:26:01 brian Exp $ * * TODO: */ @@ -166,7 +166,7 @@ PapInput(struct mbuf * bp) SendPapCode(php->id, PAP_ACK, "Greetings!!"); lcp->auth_ineed = 0; if (lcp->auth_iwait == 0) { - if ((mode & MODE_DIRECT) && isatty(modem) && Enabled(ConfUtmp)) + if ((mode & MODE_DIRECT) && isatty(modem) && Enabled(ConfUtmp)) { if (Utmp) LogPrintf(LogERROR, "Oops, already logged in on %s\n", VarBaseDevice); @@ -179,6 +179,7 @@ PapInput(struct mbuf * bp) ID0login(&ut); Utmp = 1; } + } NewPhase(PHASE_NETWORK); } } else { diff --git a/usr.sbin/ppp/route.c b/usr.sbin/ppp/route.c index 6d03059580d..55e2a0ec15c 100644 --- a/usr.sbin/ppp/route.c +++ b/usr.sbin/ppp/route.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: route.c,v 1.15 1998/01/21 02:13:40 brian Exp $ + * $Id: route.c,v 1.16 1998/03/13 01:26:03 brian Exp $ * */ @@ -100,7 +100,7 @@ OsSetRoute(int cmd, cp = rtmes.m_space; memcpy(cp, &rtdata, 16); cp += 16; - if (cmd == RTM_ADD) + if (cmd == RTM_ADD) { if (gateway.s_addr == INADDR_ANY) { /* Add a route through the interface */ struct sockaddr_dl dl; @@ -127,6 +127,7 @@ OsSetRoute(int cmd, cp += 16; rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY; } + } if (dst.s_addr == INADDR_ANY) mask.s_addr = INADDR_ANY; @@ -149,7 +150,7 @@ OsSetRoute(int cmd, LogPrintf(LogTCPIP, "OsSetRoute: Mask = %s\n", inet_ntoa(mask)); failed: if (cmd == RTM_ADD && (rtmes.m_rtm.rtm_errno == EEXIST || - (rtmes.m_rtm.rtm_errno == 0 && errno == EEXIST))) + (rtmes.m_rtm.rtm_errno == 0 && errno == EEXIST))) { if (!bang) LogPrintf(LogWARN, "Add route failed: %s already exists\n", inet_ntoa(dst)); @@ -158,7 +159,7 @@ failed: if ((wb = ID0write(s, &rtmes, nb)) < 0) goto failed; } - else if (cmd == RTM_DELETE && + } else if (cmd == RTM_DELETE && (rtmes.m_rtm.rtm_errno == ESRCH || (rtmes.m_rtm.rtm_errno == 0 && errno == ESRCH))) { if (!bang) @@ -223,8 +224,8 @@ p_sockaddr(struct sockaddr *phost, struct sockaddr *pmask, int width) case AF_LINK: if (dl->sdl_nlen) snprintf(buf, sizeof buf, "%.*s", dl->sdl_nlen, dl->sdl_data); - else if (dl->sdl_alen) - if (dl->sdl_type == IFT_ETHER) + else if (dl->sdl_alen) { + if (dl->sdl_type == IFT_ETHER) { if (dl->sdl_alen < sizeof buf / 3) { int f; u_char *MAC; @@ -235,9 +236,9 @@ p_sockaddr(struct sockaddr *phost, struct sockaddr *pmask, int width) buf[f*3-1] = '\0'; } else strcpy(buf, "??:??:??:??:??:??"); - else + } else sprintf(buf, "<IFT type %d>", dl->sdl_type); - else if (dl->sdl_slen) + } else if (dl->sdl_slen) sprintf(buf, "<slen %d?>", dl->sdl_slen); else sprintf(buf, "link#%d", dl->sdl_index); |