From: Aki Tuomi Date: Sat, 12 Dec 2015 20:56:47 +0000 (+0200) Subject: Remove pdns_strtoui X-Git-Tag: dnsdist-1.0.0-alpha1~34^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db5b684f4954eb10748adbbbf06bc5f461406627;p=pdns Remove pdns_strtoui --- diff --git a/pdns/misc.cc b/pdns/misc.cc index a7b18c90e..9c3e33c65 100644 --- a/pdns/misc.cc +++ b/pdns/misc.cc @@ -1042,20 +1042,6 @@ bool setSocketTimestamps(int fd) return true; // we pretend this happened. } -uint32_t pdns_strtoui(const char *nptr, char **endptr, int base) -{ -#if ULONG_MAX == 4294967295 - return strtoul(nptr, endptr, base); -#else - unsigned long val = strtoul(nptr, endptr, base); - if (val > UINT_MAX) { - errno = ERANGE; - return UINT_MAX; - } - - return val; -#endif -} bool setNonBlocking(int sock) { int flags=fcntl(sock,F_GETFL,0); diff --git a/pdns/misc.hh b/pdns/misc.hh index 14b887b95..260ee7c36 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -70,7 +70,6 @@ uint16_t getShort(const unsigned char *p); uint16_t getShort(const char *p); uint32_t getLong(const unsigned char *p); uint32_t getLong(const char *p); -uint32_t pdns_strtoui(const char *nptr, char **endptr, int base); bool getTSIGHashEnum(const DNSName& algoName, TSIGHashEnum& algoEnum); DNSName getTSIGAlgoName(TSIGHashEnum& algoEnum);