diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-14 13:36:48 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-14 13:36:48 +1000 |
commit | 6e55663080e33d1856d949d60e45b135f2613087 (patch) | |
tree | 7318387028176038ca96344831febb30a582d661 /include/libbb.h | |
parent | c6933c626b97c3f6bc446586ee2e6c7d9930c938 (diff) | |
parent | dcaed97e0f44d0cd285fb590ec6ec80d0d73e738 (diff) | |
download | busybox-w32-6e55663080e33d1856d949d60e45b135f2613087.tar.gz busybox-w32-6e55663080e33d1856d949d60e45b135f2613087.tar.bz2 busybox-w32-6e55663080e33d1856d949d60e45b135f2613087.zip |
Merge branch 'origin/master' (early part)
Diffstat (limited to 'include/libbb.h')
-rw-r--r-- | include/libbb.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h index a7814b75f..3a7a8f33f 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -201,7 +201,7 @@ typedef unsigned long long uoff_t; | |||
201 | /* While sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway. | 201 | /* While sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway. |
202 | * gcc will throw warnings on printf("%d", off_t). Crap... */ | 202 | * gcc will throw warnings on printf("%d", off_t). Crap... */ |
203 | typedef unsigned long uoff_t; | 203 | typedef unsigned long uoff_t; |
204 | # define XATOOFF(a) xatoi_u(a) | 204 | # define XATOOFF(a) xatoi_positive(a) |
205 | # define BB_STRTOOFF bb_strtou | 205 | # define BB_STRTOOFF bb_strtou |
206 | # define STRTOOFF strtol | 206 | # define STRTOOFF strtol |
207 | # define OFF_FMT "l" | 207 | # define OFF_FMT "l" |
@@ -781,11 +781,16 @@ struct suffix_mult { | |||
781 | }; | 781 | }; |
782 | #include "xatonum.h" | 782 | #include "xatonum.h" |
783 | /* Specialized: */ | 783 | /* Specialized: */ |
784 | |||
784 | /* Using xatoi() instead of naive atoi() is not always convenient - | 785 | /* Using xatoi() instead of naive atoi() is not always convenient - |
785 | * in many places people want *non-negative* values, but store them | 786 | * in many places people want *non-negative* values, but store them |
786 | * in signed int. Therefore we need this one: | 787 | * in signed int. Therefore we need this one: |
787 | * dies if input is not in [0, INT_MAX] range. Also will reject '-0' etc */ | 788 | * dies if input is not in [0, INT_MAX] range. Also will reject '-0' etc. |
788 | int xatoi_u(const char *numstr) FAST_FUNC; | 789 | * It should really be named xatoi_nonnegative (since it allows 0), |
790 | * but that would be too long. | ||
791 | */ | ||
792 | int xatoi_positive(const char *numstr) FAST_FUNC; | ||
793 | |||
789 | /* Useful for reading port numbers */ | 794 | /* Useful for reading port numbers */ |
790 | uint16_t xatou16(const char *numstr) FAST_FUNC; | 795 | uint16_t xatou16(const char *numstr) FAST_FUNC; |
791 | 796 | ||