summaryrefslogtreecommitdiffstats
path: root/lib/libutil/fmt_scaled.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2005-10-19 18:48:11 +0000
committerderaadt <deraadt@openbsd.org>2005-10-19 18:48:11 +0000
commit0cbef5eaab3b58d1178e3e61825cf570f152544d (patch)
treeaf4d1578d0c498983ad5b29ef8ecb3ef6777ec72 /lib/libutil/fmt_scaled.c
parentadd missing header for HISTORY section; ok jmc awhile ago (diff)
downloadwireguard-openbsd-0cbef5eaab3b58d1178e3e61825cf570f152544d.tar.xz
wireguard-openbsd-0cbef5eaab3b58d1178e3e61825cf570f152544d.zip
library routines should not be checking for NULL pointers passed in,
and then setting errno to EFAULT. that is balony programming! they should keep stumbling along to purposely create a crash, so that the programmer stops doing that kind of stupid crap. ok otto
Diffstat (limited to 'lib/libutil/fmt_scaled.c')
-rw-r--r--lib/libutil/fmt_scaled.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/libutil/fmt_scaled.c b/lib/libutil/fmt_scaled.c
index 6b87482858d..a48227bf869 100644
--- a/lib/libutil/fmt_scaled.c
+++ b/lib/libutil/fmt_scaled.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fmt_scaled.c,v 1.7 2005/08/02 21:46:23 espie Exp $ */
+/* $OpenBSD: fmt_scaled.c,v 1.8 2005/10/19 18:48:11 deraadt Exp $ */
/*
* Copyright (c) 2001, 2002, 2003 Ian F. Darwin. All rights reserved.
@@ -76,11 +76,6 @@ scan_scaled(char *scaled, long long *result)
unsigned int i, ndigits = 0, fract_digits = 0;
long long scale_fact = 1, whole = 0, fpart = 0;
- if (p == NULL || result == NULL) {
- errno = EFAULT;
- return -1;
- }
-
/* Skip leading whitespace */
while (*p && isascii(*p) && isspace(*p))
++p;
@@ -197,11 +192,6 @@ fmt_scaled(long long number, char *result)
unsigned int i;
unit_type unit = NONE;
- if (result == NULL) {
- errno = EFAULT;
- return -1;
- }
-
abval = (number < 0LL) ? -number : number; /* no long long_abs yet */
/* Not every negative long long has a positive representation.