summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2009-06-20 15:00:05 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2009-06-20 15:00:05 +0000
commitadfc14e5d3756ef6d2c25867b9ba3431ca38358f (patch)
treea93c12a476ea48dd8ba68025a52fffa4ea5ef474 /lib
parentd013de3e5004f1b890fe8ec1e62e9e33a466b04f (diff)
use llabs instead of the home-grown version; and some comment changes
ok ian@, millert@
Diffstat (limited to 'lib')
-rw-r--r--lib/libutil/fmt_scaled.c8
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