[PATCH resend 1/3] lib/replace: Replace BSD strtoull by wrapping strtoull instead of strtouq
Felix Janda
felix.janda at posteo.de
Fri Jul 17 12:51:09 UTC 2015
Same as commit e50bf6d537ef09e936d19d6e0bf63f9bbc5d4818 but for strtoull
instead of strtoll.
Signed-off-by: Felix Janda <felix.janda at posteo.de>
---
lib/replace/replace.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/lib/replace/replace.c b/lib/replace/replace.c
index dccf514..2421f97 100644
--- a/lib/replace/replace.c
+++ b/lib/replace/replace.c
@@ -552,11 +552,10 @@ unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
}
#else
#ifdef HAVE_BSD_STRTOLL
-#ifdef HAVE_STRTOUQ
unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
{
- unsigned long long int nb = strtouq(str, endptr, base);
- /* In linux EINVAL is only returned if base is not ok */
+ unsigned long long int nb = strtoull(str, endptr, base);
+ /* With glibc EINVAL is only returned if base is not ok */
if (errno == EINVAL) {
if (base == 0 || (base >1 && base <37)) {
/* Base was ok so it's because we were not
@@ -568,9 +567,6 @@ unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
}
return nb;
}
-#else
-#error "You need the strtouq function"
-#endif /* HAVE_STRTOUQ */
#endif /* HAVE_BSD_STRTOLL */
#endif /* HAVE_STRTOULL */
--
2.3.6
More information about the samba-technical
mailing list