diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-11-24 00:54:31 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-11-24 00:54:31 +0000 |
commit | a558abec9359523a726dbcdbdf990d25b9e1fa65 (patch) | |
tree | 4521e13827eeb0b35690aa8765a5267e9abaa2a8 | |
parent | e73482f4be9e03b0926b2e394ccb678161e36eca (diff) |
fairly obvious ctype cleanup dealing with argv
ok jca
-rw-r--r-- | usr.sbin/mtrace/mtrace.c | 25 | ||||
-rw-r--r-- | usr.sbin/ppp/ppp/command.c | 4 |
2 files changed, 16 insertions, 13 deletions
diff --git a/usr.sbin/mtrace/mtrace.c b/usr.sbin/mtrace/mtrace.c index edaf30fdb30..c881db9a167 100644 --- a/usr.sbin/mtrace/mtrace.c +++ b/usr.sbin/mtrace/mtrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mtrace.c,v 1.31 2013/04/24 06:00:35 deraadt Exp $ */ +/* $OpenBSD: mtrace.c,v 1.32 2013/11/24 00:54:12 deraadt Exp $ */ /* $NetBSD: mtrace.c,v 1.5 1995/12/10 10:57:15 mycroft Exp $ */ /* @@ -186,9 +186,12 @@ host_addr(char *name) * if the name is all numeric. */ for (i = sizeof(buf) - 7; i > 0; --i) { - if (*ip == '.') --dots; - else if (*ip == '\0') break; - else if (!isdigit(*ip)) dots = 0; /* Not numeric, don't add zeroes */ + if (*ip == '.') + --dots; + else if (*ip == '\0') + break; + else if (!isdigit((unsigned char)*ip)) + dots = 0; /* Not numeric, don't add zeroes */ *op++ = *ip++; } for (i = 0; i < dots; ++i) { @@ -1132,13 +1135,13 @@ main(int argc, char *argv[]) do { char c = *p++; char *arg = (char *) 0; - if (isdigit(*p)) { + if (isdigit((unsigned char)*p)) { arg = p; p = ""; } else if (argc > 0) arg = argv[0]; switch (c) { case 'd': /* Unlisted debug print option */ - if (arg && isdigit(*arg)) { + if (arg && isdigit((unsigned char)*arg)) { debug = atoi(arg); if (debug < 0) debug = 0; if (debug > 3) debug = 3; @@ -1165,7 +1168,7 @@ main(int argc, char *argv[]) numstats = 0; break; case 'w': /* Time to wait for packet arrival */ - if (arg && isdigit(*arg)) { + if (arg && isdigit((unsigned char)*arg)) { timeout = atoi(arg); if (timeout < 1) timeout = 1; if (arg == argv[0]) argv++, argc--; @@ -1173,7 +1176,7 @@ main(int argc, char *argv[]) } else goto usage; case 'm': /* Max number of hops to trace */ - if (arg && isdigit(*arg)) { + if (arg && isdigit((unsigned char)*arg)) { qno = atoi(arg); if (qno > MAXHOPS) qno = MAXHOPS; else if (qno < 1) qno = 0; @@ -1182,7 +1185,7 @@ main(int argc, char *argv[]) } else goto usage; case 'q': /* Number of query retries */ - if (arg && isdigit(*arg)) { + if (arg && isdigit((unsigned char)*arg)) { nqueries = atoi(arg); if (nqueries < 1) nqueries = 1; if (arg == argv[0]) argv++, argc--; @@ -1196,7 +1199,7 @@ main(int argc, char *argv[]) } else goto usage; case 't': /* TTL for query packet */ - if (arg && isdigit(*arg)) { + if (arg && isdigit((unsigned char)*arg)) { qttl = atoi(arg); if (qttl < 1) qttl = 1; rttl = qttl; @@ -1217,7 +1220,7 @@ main(int argc, char *argv[]) } else goto usage; case 'S': /* Stat accumulation interval */ - if (arg && isdigit(*arg)) { + if (arg && isdigit((unsigned char)*arg)) { statint = atoi(arg); if (statint < 1) statint = 1; if (arg == argv[0]) argv++, argc--; diff --git a/usr.sbin/ppp/ppp/command.c b/usr.sbin/ppp/ppp/command.c index 6422edc267f..248074b8a1b 100644 --- a/usr.sbin/ppp/ppp/command.c +++ b/usr.sbin/ppp/ppp/command.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: command.c,v 1.93 2013/04/29 00:28:23 okan Exp $ + * $OpenBSD: command.c,v 1.94 2013/11/24 00:54:30 deraadt Exp $ */ #include <sys/param.h> @@ -3110,7 +3110,7 @@ RunListCommand(struct cmdargs const *arg) #ifndef NONAT if (arg->cmd->args == NatCommands && - tolower(*arg->argv[arg->argn - 1]) == 'a') { + tolower((unsigned char)*arg->argv[arg->argn - 1]) == 'a') { if (arg->prompt) prompt_Printf(arg->prompt, "The alias command is deprecated\n"); else |