diff options
author | 2009-06-20 15:00:04 +0000 | |
---|---|---|
committer | 2009-06-20 15:00:04 +0000 | |
commit | 1fb9eadb614c1a774a0b3648ccda09608b0459ac (patch) | |
tree | b709440801889bc689949999191d86c51abb2753 /lib/libutil | |
parent | Force atapiscsi to depend upon wdc_base. This allows kernels to have (diff) | |
download | wireguard-openbsd-1fb9eadb614c1a774a0b3648ccda09608b0459ac.tar.xz wireguard-openbsd-1fb9eadb614c1a774a0b3648ccda09608b0459ac.zip |
use llabs instead of the home-grown version; and some comment changes
ok ian@, millert@
Diffstat (limited to 'lib/libutil')
-rw-r--r-- | lib/libutil/fmt_scaled.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libutil/fmt_scaled.c b/lib/libutil/fmt_scaled.c index 134dbfbd733..58f8d2452a0 100644 --- a/lib/libutil/fmt_scaled.c +++ b/lib/libutil/fmt_scaled.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fmt_scaled.c,v 1.9 2007/03/20 03:42:52 tedu Exp $ */ +/* $OpenBSD: fmt_scaled.c,v 1.10 2009/06/20 15:00:04 martynas Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Ian F. Darwin. All rights reserved. @@ -65,7 +65,7 @@ static long long scale_factors[] = { #define MAX_DIGITS (SCALE_LENGTH * 3) /* XXX strlen(sprintf("%lld", -1)? */ -/** Convert the given input string "scaled" into numeric in "result". +/* Convert the given input string "scaled" into numeric in "result". * Return 0 on success, -1 and errno set on error. */ int @@ -146,7 +146,7 @@ scan_scaled(char *scaled, long long *result) /* Validate scale factor, and scale whole and fraction by it. */ for (i = 0; i < SCALE_LENGTH; i++) { - /** Are we there yet? */ + /* Are we there yet? */ if (*p == scale_chars[i] || *p == tolower(scale_chars[i])) { @@ -192,7 +192,7 @@ fmt_scaled(long long number, char *result) unsigned int i; unit_type unit = NONE; - abval = (number < 0LL) ? -number : number; /* no long long_abs yet */ + abval = llabs(number); /* Not every negative long long has a positive representation. * Also check for numbers that are just too darned big to format |