From 8343c707533e9acd53898778f386a1d93d57763f Mon Sep 17 00:00:00 2001 From: Felix Janda Date: Thu, 22 Oct 2015 12:32:48 +0200 Subject: [PATCH] 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 Reviewed-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- lib/replace/replace.c | 9 +++------ 1 file 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 */ -- 2.34.1