diff options
author | 2010-08-14 14:34:36 +0000 | |
---|---|---|
committer | 2010-08-14 14:34:36 +0000 | |
commit | 5a56d7a540f54ef7f6880bd2c18aea3c53d70c05 (patch) | |
tree | 3912e410a36665aed3e26f82a0a8629ee8057392 /libutil | |
parent | a8f36331941fca2350e8f1e0758d6594dbe6b1e0 (diff) | |
download | pw-darwin-5a56d7a540f54ef7f6880bd2c18aea3c53d70c05.tar.gz pw-darwin-5a56d7a540f54ef7f6880bd2c18aea3c53d70c05.tar.zst pw-darwin-5a56d7a540f54ef7f6880bd2c18aea3c53d70c05.zip |
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 'libutil')
-rw-r--r-- | libutil/libutil.h | 2 |
1 files changed, 1 insertions, 1 deletions
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); |