From 5a56d7a540f54ef7f6880bd2c18aea3c53d70c05 Mon Sep 17 00:00:00 2001 From: Dag-Erling Smørgrav Date: Sat, 14 Aug 2010 14:34:36 +0000 Subject: Simplify expand_number() by combining the (unrolled) loop with the switch. Since expand_number() does not accept negative numbers, switch from int64_t to uint64_t; this makes it easier to check for overflow. MFC after: 3 weeks --- libutil/libutil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libutil') diff --git a/libutil/libutil.h b/libutil/libutil.h index 5b7ffad..3d8f59e 100644 --- a/libutil/libutil.h +++ b/libutil/libutil.h @@ -109,7 +109,7 @@ int forkpty(int *_amaster, char *_name, struct termios *_termp, struct winsize *_winp); int humanize_number(char *_buf, size_t _len, int64_t _number, const char *_suffix, int _scale, int _flags); -int expand_number(const char *_buf, int64_t *_num); +int expand_number(const char *_buf, uint64_t *_num); const char *uu_lockerr(int _uu_lockresult); int uu_lock(const char *_ttyname); int uu_unlock(const char *_ttyname); -- cgit v1.2.3-56-ge451