diff options
author | des <des@FreeBSD.org> | 2010-08-14 14:34:36 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2010-08-14 14:34:36 +0000 |
commit | b1567fc88a793d2451dccca6af424040a30ca275 (patch) | |
tree | 8aa22a76cb1718df0d484eefe5706aa137dc3d00 /lib/libutil/libutil.h | |
parent | 03b390ec5396151ffe7d1d9d293066f626c262d1 (diff) | |
download | FreeBSD-src-b1567fc88a793d2451dccca6af424040a30ca275.zip FreeBSD-src-b1567fc88a793d2451dccca6af424040a30ca275.tar.gz |
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
Diffstat (limited to 'lib/libutil/libutil.h')
-rw-r--r-- | lib/libutil/libutil.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h index 5b7ffad..3d8f59e 100644 --- a/lib/libutil/libutil.h +++ b/lib/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); |