Browse Source

remove some bogus *p from charles longeau

ok deraadt millert
OPENBSD_4_2
tedu 17 years ago
parent
commit
95e05a31f0
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/lib/libutil/fmt_scaled.c

+ 4
- 4
src/lib/libutil/fmt_scaled.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: fmt_scaled.c,v 1.8 2005/10/19 18:48:11 deraadt Exp $ */
/* $OpenBSD: fmt_scaled.c,v 1.9 2007/03/20 03:42:52 tedu Exp $ */
/* /*
* Copyright (c) 2001, 2002, 2003 Ian F. Darwin. All rights reserved. * Copyright (c) 2001, 2002, 2003 Ian F. Darwin. All rights reserved.
@ -77,7 +77,7 @@ scan_scaled(char *scaled, long long *result)
long long scale_fact = 1, whole = 0, fpart = 0; long long scale_fact = 1, whole = 0, fpart = 0;
/* Skip leading whitespace */ /* Skip leading whitespace */
while (*p && isascii(*p) && isspace(*p))
while (isascii(*p) && isspace(*p))
++p; ++p;
/* Then at most one leading + or - */ /* Then at most one leading + or - */
@ -104,7 +104,7 @@ scan_scaled(char *scaled, long long *result)
* (but note that E for Exa might look like e to some!). * (but note that E for Exa might look like e to some!).
* Advance 'p' to end, to get scale factor. * Advance 'p' to end, to get scale factor.
*/ */
for (; *p && isascii(*p) && (isdigit(*p) || *p=='.'); ++p) {
for (; isascii(*p) && (isdigit(*p) || *p=='.'); ++p) {
if (*p == '.') { if (*p == '.') {
if (fract_digits > 0) { /* oops, more than one '.' */ if (fract_digits > 0) { /* oops, more than one '.' */
errno = EINVAL; errno = EINVAL;
@ -151,7 +151,7 @@ scan_scaled(char *scaled, long long *result)
*p == tolower(scale_chars[i])) { *p == tolower(scale_chars[i])) {
/* If it ends with alphanumerics after the scale char, bad. */ /* If it ends with alphanumerics after the scale char, bad. */
if (*(p+1) != '\0' && isalnum(*(p+1))) {
if (isalnum(*(p+1))) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }


Loading…
Cancel
Save