diff --git a/Makefile.in b/Makefile.in index a9427bc36..70e9da0c3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -91,12 +91,6 @@ IRCDMODE = 711 URL=@URL@ -# [CHANGEME] -# If you get a link-time error dealing with strtoul, comment out -# this line. -# STRTOUL= strtoul.o -STRTOUL=@STRTOUL@ - # Where is your openssl binary OPENSSLPATH=@OPENSSLPATH@ @@ -119,7 +113,7 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'IRCDLIBS=${IRCDLIBS}' \ 'RES=${RES}' 'BINDIR=${BINDIR}' 'INSTALL=${INSTALL}' \ 'INCLUDEDIR=${INCLUDEDIR}' \ 'RM=${RM}' 'CP=${CP}' 'TOUCH=${TOUCH}' \ - 'SHELL=${SHELL}' 'STRTOUL=${STRTOUL}' \ + 'SHELL=${SHELL}' \ 'CRYPTOLIB=${CRYPTOLIB}' \ 'CRYPTOINCLUDES=${CRYPTOINCLUDES}' \ 'URL=${URL}' diff --git a/configure b/configure index 4e7d93fd1..f82b7ebc9 100755 --- a/configure +++ b/configure @@ -662,7 +662,6 @@ BINDIR DYNAMIC_LDFLAGS MODULEFLAGS CRYPTOLIB -STRTOUL EGREP GREP CPP @@ -5731,19 +5730,6 @@ fi done -for ac_func in strtoul -do : - ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul" -if test "x$ac_cv_func_strtoul" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRTOUL 1 -_ACEOF - -else - STRTOUL="strtoul.o" -fi -done - for ac_func in explicit_bzero do : ac_fn_c_check_func "$LINENO" "explicit_bzero" "ac_cv_func_explicit_bzero" @@ -5774,7 +5760,6 @@ done - # Check whether --with-nick-history was given. if test "${with_nick_history+set}" = set; then : withval=$with_nick_history; diff --git a/configure.ac b/configure.ac index 142b29dbd..7c446e65f 100644 --- a/configure.ac +++ b/configure.ac @@ -346,10 +346,8 @@ AC_CHECK_FUNCS([setproctitle], ] ) -AC_CHECK_FUNCS(strtoul,,STRTOUL="strtoul.o") AC_CHECK_FUNCS(explicit_bzero,AC_DEFINE([HAVE_EXPLICIT_BZERO], [], [Define if you have explicit_bzero])) AC_CHECK_FUNCS(syslog,AC_DEFINE([HAVE_SYSLOG], [], [Define if you have syslog])) -AC_SUBST(STRTOUL) AC_SUBST(CRYPTOLIB) AC_SUBST(MODULEFLAGS) AC_SUBST(DYNAMIC_LDFLAGS) diff --git a/include/setup.h.in b/include/setup.h.in index 1301a8423..da36ebb07 100644 --- a/include/setup.h.in +++ b/include/setup.h.in @@ -103,9 +103,6 @@ /* Define to 1 if you have the `strlncat' function. */ #undef HAVE_STRLNCAT -/* Define to 1 if you have the `strtoul' function. */ -#undef HAVE_STRTOUL - /* Define to 1 if you have the `syslog' function. */ #undef HAVE_SYSLOG diff --git a/src/Makefile.in b/src/Makefile.in index 4646a52e8..48164b18b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -25,7 +25,7 @@ OBJS=dns.o bsd.o auth.o channel.o cloak.o crule.o dbuf.o \ fdlist.o hash.o ircd.o ircsprintf.o list.o \ match.o modules.o packet.o parse.o mempool.o operclass.o \ conf_preprocessor.o conf.o debug.o dispatch.o err.o extra.o kline.o \ - misc.o numeric.o serv.o aliases.o $(STRTOUL) socket.o \ + misc.o numeric.o serv.o aliases.o socket.o \ tls.o user.o scache.o send.o support.o \ version.o whowas.o random.o api-usermode.o api-channelmode.o \ api-moddata.o uid.o api-extban.o api-isupport.o api-command.o \ diff --git a/src/strtoul.c b/src/strtoul.c deleted file mode 100644 index 1bb5b8444..000000000 --- a/src/strtoul.c +++ /dev/null @@ -1,123 +0,0 @@ -/* $NetBSD: strtoul.c,v 1.9 1996/07/20 01:00:57 jtc Exp $ */ - -/* - * Copyright (c) 1990 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#if defined(LIBC_SCCS) && !defined(lint) -#if 0 -static char *sccsid = "from: @(#)strtoul.c 5.3 (Berkeley) 2/23/91"; -#else -static char *rcsid = "$NetBSD: strtoul.c,v 1.9 1996/07/20 01:00:57 jtc Exp $"; -#endif -#endif /* LIBC_SCCS and not lint */ - -#include -#include -#include -#include - -/* - * Convert a string to an unsigned long integer. - * - * Ignores `locale' stuff. Assumes that the upper and lower case - * alphabets and digits are each contiguous. - */ -unsigned long strtoul(char *nptr, char **endptr, int base) -{ - char *s; - unsigned long acc, cutoff; - int c; - int neg, any, cutlim; - - /* - * See strtol for comments as to the logic used. - */ - s = nptr; - do - { - c = (unsigned char)*s++; - } - while (isspace(c)); - if (c == '-') - { - neg = 1; - c = *s++; - } - else - { - neg = 0; - if (c == '+') - c = *s++; - } - if ((base == 0 || base == 16) && c == '0' && (*s == 'x' || *s == 'X')) - { - c = s[1]; - s += 2; - base = 16; - } - if (base == 0) - base = c == '0' ? 8 : 10; - - cutoff = ULONG_MAX / (unsigned long)base; - cutlim = ULONG_MAX % (unsigned long)base; - for (acc = 0, any = 0;; c = (unsigned char)*s++) - { - if (isdigit(c)) - c -= '0'; - else if (isalpha(c)) - c -= isupper(c) ? 'A' - 10 : 'a' - 10; - else - break; - if (c >= base) - break; - if (any < 0) - continue; - if (acc > cutoff || acc == cutoff && c > cutlim) - { - any = -1; - acc = ULONG_MAX; - errno = ERANGE; - } - else - { - any = 1; - acc *= (unsigned long)base; - acc += c; - } - } - if (neg && any > 0) - acc = -acc; - if (endptr != 0) - *endptr = (char *)(any ? s - 1 : nptr); - return (acc); -}