=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/top/commands.c,v retrieving revision 1.30 retrieving revision 1.31 diff -c -r1.30 -r1.31 *** src/usr.bin/top/commands.c 2010/04/01 05:05:19 1.30 --- src/usr.bin/top/commands.c 2013/11/28 18:24:55 1.31 *************** *** 1,4 **** ! /* $OpenBSD: commands.c,v 1.30 2010/04/01 05:05:19 lum Exp $ */ /* * Top users/processes display for Unix --- 1,4 ---- ! /* $OpenBSD: commands.c,v 1.31 2013/11/28 18:24:55 deraadt Exp $ */ /* * Top users/processes display for Unix *************** *** 100,108 **** return (-1); while ((ch = *str++) != '\0') { ! if (isspace(ch)) break; ! else if (!isdigit(ch)) bad_flag = 1; else val = val * 10 + (ch - '0'); --- 100,108 ---- return (-1); while ((ch = *str++) != '\0') { ! if (isspace((unsigned char)ch)) break; ! else if (!isdigit((unsigned char)ch)) bad_flag = 1; else val = val * 10 + (ch - '0'); *************** *** 284,290 **** uid = getuid(); /* skip over leading white space */ ! while (isspace(*str)) str++; if (*str == '-') { --- 284,290 ---- uid = getuid(); /* skip over leading white space */ ! while (isspace((unsigned char)*str)) str++; if (*str == '-') { *************** *** 294,300 **** if ((nptr = next_field(str)) == NULL) return (" kill: no processes specified"); ! if (isdigit(*str)) { (void) scan_arg(str, &signum, tmp); if (signum <= 0 || signum >= NSIG) return (" invalid signal number"); --- 294,300 ---- if ((nptr = next_field(str)) == NULL) return (" kill: no processes specified"); ! if (isdigit((unsigned char)*str)) { (void) scan_arg(str, &signum, tmp); if (signum <= 0 || signum >= NSIG) return (" invalid signal number"); *************** *** 352,358 **** uid = getuid(); /* skip over leading white space */ ! while (isspace(*str)) str++; /* allow for negative priority values */ --- 352,358 ---- uid = getuid(); /* skip over leading white space */ ! while (isspace((unsigned char)*str)) str++; /* allow for negative priority values */