Browse Source

make scan_scaled set errno to EINVAL rather than ERANGE if it encounters

an invalid multiplier, like the man page says it should
"looks sensible" deraadt@, ok ian@
OPENBSD_5_3
halex 12 years ago
parent
commit
fcf6db6614
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      src/lib/libutil/fmt_scaled.c

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

@ -1,4 +1,4 @@
/* $OpenBSD: fmt_scaled.c,v 1.10 2009/06/20 15:00:04 martynas Exp $ */
/* $OpenBSD: fmt_scaled.c,v 1.11 2012/11/12 14:07:20 halex Exp $ */
/*
* Copyright (c) 2001, 2002, 2003 Ian F. Darwin. All rights reserved.
@ -177,7 +177,9 @@ scan_scaled(char *scaled, long long *result)
return 0;
}
}
errno = ERANGE;
/* Invalid unit or character */
errno = EINVAL;
return -1;
}


Loading…
Cancel
Save