summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFelix Janda <felix.janda@posteo.de>2015-10-22 12:32:48 +0200
committerStefan Metzmacher <metze@samba.org>2015-10-31 22:03:14 +0100
commit8343c707533e9acd53898778f386a1d93d57763f (patch)
tree383cb36179a4d7df8ff5dfaab323b3fb6010e58c /lib
parentf30a8a28322b1a83909388f983800f99a8c77c14 (diff)
downloadsamba-8343c707533e9acd53898778f386a1d93d57763f.tar.gz
lib/replace: Replace BSD strtoull by wrapping strtoull instead of strtouq
Same as commit e50bf6d537ef09e936d19d6e0bf63f9bbc5d4818 but for strtoull instead of strtoll. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11455 Signed-off-by: Felix Janda <felix.janda@posteo.de> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/replace/replace.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/replace/replace.c b/lib/replace/replace.c
index c9c12a4ac9a..ce8f38a6e73 100644
--- a/lib/replace/replace.c
+++ b/lib/replace/replace.c
@@ -573,11 +573,11 @@ unsigned long long int rep_strtoull(const char *str, char **endptr, int base)
}
#else
#ifdef HAVE_BSD_STRTOLL
-#ifdef HAVE_STRTOUQ
+#undef strtoull
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
@@ -589,9 +589,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 */