r8698: attempt to cope with lack of strtoull() on HPUX
authorAndrew Tridgell <tridge@samba.org>
Fri, 22 Jul 2005 03:46:57 +0000 (03:46 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:29:55 +0000 (13:29 -0500)
(This used to be commit c84c516b179fcbbcdb36c0c0aa4ffb4ff12f2c35)

source4/lib/replace/replace.c

index 79b452d69c513130c23f1f21a190c15b53e8b681..20a420084a1d2ed32eeb2c14fb093043fc690190 100644 (file)
@@ -512,7 +512,15 @@ int get_time_zone(time_t t)
 #ifdef HAVE_STRTOUQ
        return strtouq(str, endptr, base);
 #else
-#error "system must support 64 bit integer read from strings"
+       unsigned long long int v;
+       if (sscanf(str, "%lli", &v) != 1) {
+               smb_panic("system does not support %lli in sscanf");
+       }
+       if (endptr) {
+               /* try to get endptr right - uggh */
+               strtoul(str, endptr, base);
+       }
+       return v;
 #endif
 }
 #endif