summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenys Vlasenko2010-08-12 14:14:45 +0200
committerDenys Vlasenko2010-08-12 14:14:45 +0200
commit7783248eaac715b813f0635b06cc140ea99bb4d9 (patch)
treeb7c3acbdf7e45afdb31a721a693f0a8a65f80730 /include
parent7bfbbd434a6f435b0287cd25406927c630b03f68 (diff)
downloadbusybox-7783248eaac715b813f0635b06cc140ea99bb4d9.zip
busybox-7783248eaac715b813f0635b06cc140ea99bb4d9.tar.gz
*: s/xatoi_u/xatoi_positive/g - I got bored of mistyping xatoi_u as xatou_i
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 118d777..03fc5d4 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -190,7 +190,7 @@ typedef unsigned long long uoff_t;
/* While sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway.
* gcc will throw warnings on printf("%d", off_t). Crap... */
typedef unsigned long uoff_t;
-# define XATOOFF(a) xatoi_u(a)
+# define XATOOFF(a) xatoi_positive(a)
# define BB_STRTOOFF bb_strtou
# define STRTOOFF strtol
# define OFF_FMT "l"
@@ -765,11 +765,16 @@ struct suffix_mult {
};
#include "xatonum.h"
/* Specialized: */
+
/* Using xatoi() instead of naive atoi() is not always convenient -
* in many places people want *non-negative* values, but store them
* in signed int. Therefore we need this one:
- * dies if input is not in [0, INT_MAX] range. Also will reject '-0' etc */
-int xatoi_u(const char *numstr) FAST_FUNC;
+ * dies if input is not in [0, INT_MAX] range. Also will reject '-0' etc.
+ * It should really be named xatoi_nonnegative (since it allows 0),
+ * but that would be too long.
+ */
+int xatoi_positive(const char *numstr) FAST_FUNC;
+
/* Useful for reading port numbers */
uint16_t xatou16(const char *numstr) FAST_FUNC;