diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/xatonum.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/xatonum.h b/include/xatonum.h index 387545518..49ddced50 100644 --- a/include/xatonum.h +++ b/include/xatonum.h | |||
@@ -105,7 +105,18 @@ static ALWAYS_INLINE uint32_t xatou32(const char *numstr) | |||
105 | return BUG_xatou32_unimplemented(); | 105 | return BUG_xatou32_unimplemented(); |
106 | } | 106 | } |
107 | 107 | ||
108 | /* Non-aborting kind of convertors */ | 108 | /* Non-aborting kind of convertors: bb_strto[u][l]l */ |
109 | |||
110 | /* On exit: errno = 0 only if there was non-empty, '\0' terminated value | ||
111 | * errno = EINVAL if value was not '\0' terminated, but othervise ok | ||
112 | * Return value is still valid, caller should just check whether end[0] | ||
113 | * is a valid terminating char for particular case. OTOH, if caller | ||
114 | * requires '\0' terminated input, [s]he can just check errno == 0. | ||
115 | * errno = ERANGE if value had alphanumeric terminating char ("1234abcg"). | ||
116 | * errno = ERANGE if value is out of range, missing, etc. | ||
117 | * errno = ERANGE if value had minus sign for strtouXX (even "-0" is not ok ) | ||
118 | * return value is all-ones in this case. | ||
119 | */ | ||
109 | 120 | ||
110 | unsigned long long bb_strtoull(const char *arg, char **endp, int base); | 121 | unsigned long long bb_strtoull(const char *arg, char **endp, int base); |
111 | long long bb_strtoll(const char *arg, char **endp, int base); | 122 | long long bb_strtoll(const char *arg, char **endp, int base); |