From 5e1e6d3b380bdf16edb20e0b5024cb5591876c20 Mon Sep 17 00:00:00 2001 From: Michael Ortmann Date: Thu, 11 Jan 2024 16:04:20 +0100 Subject: [PATCH 1/2] Remove compat vsnprintf() (eggdrop requires posix 2001) --- configure.ac | 2 +- src/botmsg.c | 4 +- src/compat/snprintf.c | 630 +------------------------------------- src/compat/snprintf.h | 12 - src/dccutil.c | 6 +- src/eggdrop.h | 1 + src/misc.c | 2 +- src/mod/module.h | 5 +- src/mod/share.mod/share.c | 4 +- src/modules.c | 2 +- 10 files changed, 13 insertions(+), 655 deletions(-) diff --git a/configure.ac b/configure.ac index 61c67d4e4..983625542 100644 --- a/configure.ac +++ b/configure.ac @@ -113,7 +113,7 @@ AX_TYPE_SOCKLEN_T AX_CREATE_STDINT_H([eggint.h]) # Checks for functions and their arguments. -AC_CHECK_FUNCS([dprintf explicit_bzero memset_explicit explicit_memset getrandom inet_aton isascii memset_s snprintf strlcpy vsnprintf]) +AC_CHECK_FUNCS([dprintf explicit_bzero memset_explicit explicit_memset getrandom inet_aton isascii memset_s snprintf strlcpy]) AC_FUNC_SELECT_ARGTYPES EGG_FUNC_B64_NTOP AC_FUNC_MMAP diff --git a/src/botmsg.c b/src/botmsg.c index 2c00552d0..8f8a66ba4 100644 --- a/src/botmsg.c +++ b/src/botmsg.c @@ -49,7 +49,7 @@ void tandout_but(int x, const char *format, ...) va_start(va, format); - len = egg_vsnprintf(s, sizeof s, format, va); + len = vsnprintf(s, sizeof s, format, va); va_end(va); if (len >= sizeof s) { len = sizeof s - 1; @@ -298,7 +298,7 @@ void botnet_send_priv (int idx, char *from, char *to, char *tobot, const char *f va_list va; va_start(va, format); - egg_vsnprintf(tbuf, 450, format, va); + vsnprintf(tbuf, 450, format, va); va_end(va); tbuf[sizeof(tbuf) - 1] = 0; diff --git a/src/compat/snprintf.c b/src/compat/snprintf.c index 71a64e42d..c730e25c1 100644 --- a/src/compat/snprintf.c +++ b/src/compat/snprintf.c @@ -1,5 +1,5 @@ /* - * snprintf.c - a portable implementation of snprintf and vsnprintf + * snprintf.c - a portable implementation of snprintf */ /* * Portions Copyright (C) 2000 - 2023 Eggheads Development Team @@ -84,634 +84,6 @@ #include #include -#ifndef HAVE_VSNPRINTF - -/* varargs declarations: */ - -#if defined(__STDC__) -# ifdef HAVE_STDARG_H -# include -# endif -# define HAVE_STDARGS /* let's hope that works everywhere (mj) */ -# define VA_LOCAL_DECL va_list ap -# define VA_START(f) va_start(ap, f) -# define VA_SHIFT(v,t) ; /* no-op for ANSI */ -# define VA_END va_end(ap) -#else -# include -# undef HAVE_STDARGS -# define VA_LOCAL_DECL va_list ap -# define VA_START(f) va_start(ap) /* f is ignored! */ -# define VA_SHIFT(v,t) v = va_arg(ap,t) -# define VA_END va_end(ap) -#endif - -#ifdef HAVE_LONG_DOUBLE -#define LDOUBLE long double -#else -#define LDOUBLE double -#endif - -static void dopr(char *buffer, size_t maxlen, const char *format, va_list args); -static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, char *value, - int flags, int min, int max); -static void fmtint(char *buffer, size_t *currlen, size_t maxlen, long value, - int base, int min, int max, int flags); -static void fmtfp(char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, - int min, int max, int flags); -static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c); - -/* - * dopr(): poor man's version of doprintf - */ - -/* format read states */ -#define DP_S_DEFAULT 0 -#define DP_S_FLAGS 1 -#define DP_S_MIN 2 -#define DP_S_DOT 3 -#define DP_S_MAX 4 -#define DP_S_MOD 5 -#define DP_S_CONV 6 -#define DP_S_DONE 7 - -/* format flags - Bits */ -#define DP_F_MINUS (1 << 0) -#define DP_F_PLUS (1 << 1) -#define DP_F_SPACE (1 << 2) -#define DP_F_NUM (1 << 3) -#define DP_F_ZERO (1 << 4) -#define DP_F_UP (1 << 5) -#define DP_F_UNSIGNED (1 << 6) - -/* Conversion Flags */ -#define DP_C_SHORT 1 -#define DP_C_LONG 2 -#define DP_C_LDOUBLE 3 - -#define char_to_int(p) (p - '0') - -#ifdef MAX -# undef MAX -#endif -#define MAX(p,q) ((p >= q) ? p : q) - -static void dopr(char *buffer, size_t maxlen, const char *format, va_list args) -{ - char ch; - long value; - LDOUBLE fvalue; - char *strvalue; - int min; - int max; - int state; - int flags; - int cflags; - size_t currlen; - - state = DP_S_DEFAULT; - currlen = flags = cflags = min = 0; - max = -1; - ch = *format++; - - while (state != DP_S_DONE) { - if ((ch == '\0') || (currlen >= maxlen)) - state = DP_S_DONE; - - switch (state) { - case DP_S_DEFAULT: - if (ch == '%') - state = DP_S_FLAGS; - else - dopr_outch(buffer, &currlen, maxlen, ch); - ch = *format++; - break; - case DP_S_FLAGS: - switch (ch) { - case '-': - flags |= DP_F_MINUS; - ch = *format++; - break; - case '+': - flags |= DP_F_PLUS; - ch = *format++; - break; - case ' ': - flags |= DP_F_SPACE; - ch = *format++; - break; - case '#': - flags |= DP_F_NUM; - ch = *format++; - break; - case '0': - flags |= DP_F_ZERO; - ch = *format++; - break; - default: - state = DP_S_MIN; - break; - } - break; - case DP_S_MIN: - if (egg_isdigit(ch)) { - min = 10 * min + char_to_int(ch); - ch = *format++; - } else if (ch == '*') { - min = va_arg(args, int); - - ch = *format++; - state = DP_S_DOT; - } else - state = DP_S_DOT; - break; - case DP_S_DOT: - if (ch == '.') { - state = DP_S_MAX; - ch = *format++; - } else - state = DP_S_MOD; - break; - case DP_S_MAX: - if (egg_isdigit(ch)) { - if (max < 0) - max = 0; - max = 10 * max + char_to_int(ch); - ch = *format++; - } else if (ch == '*') { - max = va_arg(args, int); - - ch = *format++; - state = DP_S_MOD; - } else - state = DP_S_MOD; - break; - case DP_S_MOD: - /* Currently, we don't support Long Long, bummer */ - switch (ch) { - case 'h': - cflags = DP_C_SHORT; - ch = *format++; - break; - case 'l': - cflags = DP_C_LONG; - ch = *format++; - break; - case 'L': - cflags = DP_C_LDOUBLE; - ch = *format++; - break; - default: - break; - } - state = DP_S_CONV; - break; - case DP_S_CONV: - switch (ch) { - case 'd': - case 'i': - if (cflags == DP_C_SHORT) - value = va_arg(args, int); - - else if (cflags == DP_C_LONG) - value = va_arg(args, long int); - - else - value = va_arg(args, int); - - fmtint(buffer, &currlen, maxlen, value, 10, min, max, flags); - break; - case 'o': - flags |= DP_F_UNSIGNED; - if (cflags == DP_C_SHORT) - value = va_arg(args, unsigned int); - - else if (cflags == DP_C_LONG) - value = va_arg(args, unsigned long int); - - else - value = va_arg(args, unsigned int); - - fmtint(buffer, &currlen, maxlen, value, 8, min, max, flags); - break; - case 'u': - flags |= DP_F_UNSIGNED; - if (cflags == DP_C_SHORT) - value = va_arg(args, unsigned int); - - else if (cflags == DP_C_LONG) - value = va_arg(args, unsigned long int); - - else - value = va_arg(args, unsigned int); - - fmtint(buffer, &currlen, maxlen, value, 10, min, max, flags); - break; - case 'X': - flags |= DP_F_UP; - case 'x': - flags |= DP_F_UNSIGNED; - if (cflags == DP_C_SHORT) - value = va_arg(args, unsigned int); - - else if (cflags == DP_C_LONG) - value = va_arg(args, unsigned long int); - - else - value = va_arg(args, unsigned int); - - fmtint(buffer, &currlen, maxlen, value, 16, min, max, flags); - break; - case 'f': - if (cflags == DP_C_LDOUBLE) - fvalue = va_arg(args, LDOUBLE); - else - fvalue = va_arg(args, double); - - /* um, floating point? */ - fmtfp(buffer, &currlen, maxlen, fvalue, min, max, flags); - break; - case 'E': - flags |= DP_F_UP; - case 'e': - if (cflags == DP_C_LDOUBLE) - fvalue = va_arg(args, LDOUBLE); - else - fvalue = va_arg(args, double); - - break; - case 'G': - flags |= DP_F_UP; - case 'g': - if (cflags == DP_C_LDOUBLE) - fvalue = va_arg(args, LDOUBLE); - else - fvalue = va_arg(args, double); - - break; - case 'c': - dopr_outch(buffer, &currlen, maxlen, va_arg(args, int)); - - break; - case 's': - strvalue = va_arg(args, char *); - - if (max < 0) - max = maxlen; /* ie, no max */ - fmtstr(buffer, &currlen, maxlen, strvalue, flags, min, max); - break; - case 'p': - strvalue = va_arg(args, void *); - - fmtint(buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags); - break; - case 'n': - if (cflags == DP_C_SHORT) { - short int *num; - num = va_arg(args, short int *); - - *num = currlen; - } else if (cflags == DP_C_LONG) { - long int *num; - num = va_arg(args, long int *); - - *num = currlen; - } else { - int *num; - num = va_arg(args, int *); - - *num = currlen; - } - break; - case '%': - dopr_outch(buffer, &currlen, maxlen, ch); - break; - case 'w': - /* not supported yet, treat as next char */ - ch = *format++; - break; - default: - /* Unknown, skip */ - break; - } - ch = *format++; - state = DP_S_DEFAULT; - flags = cflags = min = 0; - max = -1; - break; - case DP_S_DONE: - break; - default: - /* hmm? */ - break; /* some picky compilers need this */ - } - } - if (currlen < maxlen - 1) - buffer[currlen] = '\0'; - else - buffer[maxlen - 1] = '\0'; -} - -static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, - char *value, int flags, int min, int max) -{ - int padlen, strln; /* amount to pad */ - int cnt = 0; - - if (value == 0) { - value = ""; - } - - for (strln = 0; value[strln]; ++strln); /* strlen */ - padlen = min - strln; - if (padlen < 0) - padlen = 0; - if (flags & DP_F_MINUS) - padlen = -padlen; /* Left Justify */ - - while ((padlen > 0) && (cnt < max)) { - dopr_outch(buffer, currlen, maxlen, ' '); - --padlen; - ++cnt; - } - while (*value && (cnt < max)) { - dopr_outch(buffer, currlen, maxlen, *value++); - ++cnt; - } - while ((padlen < 0) && (cnt < max)) { - dopr_outch(buffer, currlen, maxlen, ' '); - ++padlen; - ++cnt; - } -} - -/* Have to handle DP_F_NUM (ie 0x and 0 alternates) */ - -static void fmtint(char *buffer, size_t *currlen, size_t maxlen, - long value, int base, int min, int max, int flags) -{ - int signvalue = 0; - unsigned long uvalue; - char convert[20]; - int place = 0; - int spadlen = 0; /* amount to space pad */ - int zpadlen = 0; /* amount to zero pad */ - int caps = 0; - - if (max < 0) - max = 0; - - uvalue = value; - - if (!(flags & DP_F_UNSIGNED)) { - if (value < 0) { - signvalue = '-'; - uvalue = -value; - } else if (flags & DP_F_PLUS) /* Do a sign (+/i) */ - signvalue = '+'; - else if (flags & DP_F_SPACE) - signvalue = ' '; - } - - if (flags & DP_F_UP) - caps = 1; /* Should characters be upper case? */ - - do { - convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef") - [uvalue % (unsigned) base]; - uvalue = (uvalue / (unsigned) base); - } - while (uvalue && (place < 20)); - if (place == 20) - place--; - convert[place] = 0; - - zpadlen = max - place; - spadlen = min - MAX(max, place) - (signvalue ? 1 : 0); - if (zpadlen < 0) - zpadlen = 0; - if (spadlen < 0) - spadlen = 0; - if (flags & DP_F_ZERO) { - zpadlen = MAX(zpadlen, spadlen); - spadlen = 0; - } - if (flags & DP_F_MINUS) - spadlen = -spadlen; /* Left Justifty */ - -#ifdef DEBUG_SNPRINTF - dprint(1, - (debugfile, "zpad: %d, spad: %d, min: %d, max: %d, place: %d\n", - zpadlen, spadlen, min, max, place)); -#endif - - /* Spaces */ - while (spadlen > 0) { - dopr_outch(buffer, currlen, maxlen, ' '); - --spadlen; - } - - /* Sign */ - if (signvalue) - dopr_outch(buffer, currlen, maxlen, signvalue); - - /* Zeros */ - if (zpadlen > 0) { - while (zpadlen > 0) { - dopr_outch(buffer, currlen, maxlen, '0'); - --zpadlen; - } - } - - /* Digits */ - while (place > 0) - dopr_outch(buffer, currlen, maxlen, convert[--place]); - - /* Left Justified spaces */ - while (spadlen < 0) { - dopr_outch(buffer, currlen, maxlen, ' '); - ++spadlen; - } -} - -static LDOUBLE abs_val(LDOUBLE value) -{ - LDOUBLE result = value; - - if (value < 0) - result = -value; - - return result; -} - -static LDOUBLE pow10(int exp) -{ - LDOUBLE result = 1; - - while (exp) { - result *= 10; - exp--; - } - - return result; -} - -static long round(LDOUBLE value) -{ - long intpart; - - intpart = value; - value = value - intpart; - if (value >= 0.5) - intpart++; - - return intpart; -} - -static void fmtfp(char *buffer, size_t *currlen, size_t maxlen, - LDOUBLE fvalue, int min, int max, int flags) -{ - int signvalue = 0; - LDOUBLE ufvalue; - char iconvert[20]; - char fconvert[20]; - int iplace = 0; - int fplace = 0; - int padlen = 0; /* amount to pad */ - int zpadlen = 0; - int caps = 0; - long intpart; - long fracpart; - - /* - * AIX manpage says the default is 0, but Solaris says the default - * is 6, and sprintf on AIX defaults to 6 - */ - if (max < 0) - max = 6; - - ufvalue = abs_val(fvalue); - - if (fvalue < 0) - signvalue = '-'; - else if (flags & DP_F_PLUS) /* Do a sign (+/i) */ - signvalue = '+'; - else if (flags & DP_F_SPACE) - signvalue = ' '; - -#if 0 - if (flags & DP_F_UP) - caps = 1; /* Should characters be upper case? */ -#endif - - intpart = ufvalue; - - /* - * Sorry, we only support 9 digits past the decimal because of our - * conversion method - */ - if (max > 9) - max = 9; - - /* We "cheat" by converting the fractional part to integer by - * multiplying by a factor of 10 - */ - fracpart = round((pow10(max)) * (ufvalue - intpart)); - - if (fracpart >= pow10(max)) { - intpart++; - fracpart -= pow10(max); - } - - /* Convert integer part */ - do { - iconvert[iplace++] = - (caps ? "0123456789ABCDEF" : "0123456789abcdef")[intpart % 10]; - intpart = (intpart / 10); - } - while (intpart && (iplace < 20)); - if (iplace == 20) - iplace--; - iconvert[iplace] = 0; - - /* Convert fractional part */ - do { - fconvert[fplace++] = - (caps ? "0123456789ABCDEF" : "0123456789abcdef")[fracpart % 10]; - fracpart = (fracpart / 10); - } - while (fracpart && (fplace < 20)); - if (fplace == 20) - fplace--; - fconvert[fplace] = 0; - - /* -1 for decimal point, another -1 if we are printing a sign */ - padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0); - zpadlen = max - fplace; - if (zpadlen < 0) - zpadlen = 0; - if (padlen < 0) - padlen = 0; - if (flags & DP_F_MINUS) - padlen = -padlen; /* Left Justifty */ - - if ((flags & DP_F_ZERO) && (padlen > 0)) { - if (signvalue) { - dopr_outch(buffer, currlen, maxlen, signvalue); - --padlen; - signvalue = 0; - } - while (padlen > 0) { - dopr_outch(buffer, currlen, maxlen, '0'); - --padlen; - } - } - while (padlen > 0) { - dopr_outch(buffer, currlen, maxlen, ' '); - --padlen; - } - if (signvalue) - dopr_outch(buffer, currlen, maxlen, signvalue); - - while (iplace > 0) - dopr_outch(buffer, currlen, maxlen, iconvert[--iplace]); - - /* - * Decimal point. This should probably use locale to find the correct - * char to print out. - */ - if (max > 0) { - dopr_outch(buffer, currlen, maxlen, '.'); - - while (fplace > 0) - dopr_outch(buffer, currlen, maxlen, fconvert[--fplace]); - } - - while (zpadlen > 0) { - dopr_outch(buffer, currlen, maxlen, '0'); - --zpadlen; - } - - while (padlen < 0) { - dopr_outch(buffer, currlen, maxlen, ' '); - ++padlen; - } -} - -static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c) -{ - if (*currlen < maxlen) - buffer[(*currlen)++] = c; -} - -int egg_vsnprintf(char *str, size_t count, const char *fmt, va_list args) -{ - str[0] = 0; - dopr(str, count, fmt, args); - return (strlen(str)); -} -#endif /* !HAVE_VSNPRINTF */ - #ifndef HAVE_SNPRINTF # ifdef HAVE_STDARGS int egg_snprintf(char *str, size_t count, const char *fmt, ...) diff --git a/src/compat/snprintf.h b/src/compat/snprintf.h index d9d7ba791..bda2701d6 100644 --- a/src/compat/snprintf.h +++ b/src/compat/snprintf.h @@ -28,23 +28,11 @@ /* Check for broken snprintf versions */ #ifdef BROKEN_SNPRINTF -# ifdef HAVE_VSNPRINTF -# undef HAVE_VSNPRINTF -# endif # ifdef HAVE_SNPRINTF # undef HAVE_SNPRINTF # endif #endif -/* Use the system libraries version of vsnprintf() if available. Otherwise - * use our own. - */ -#ifndef HAVE_VSNPRINTF -int egg_vsnprintf(char *str, size_t count, const char *fmt, va_list ap); -#else -# define egg_vsnprintf vsnprintf -#endif - /* Use the system libraries version of snprintf() if available. Otherwise * use our own. */ diff --git a/src/dccutil.c b/src/dccutil.c index ece4d895d..2263c1dec 100644 --- a/src/dccutil.c +++ b/src/dccutil.c @@ -158,7 +158,7 @@ void dprintf(int idx, const char *format, ...) va_start(va, format); - egg_vsnprintf(buf, LOGLINEMAX-1, format, va); + vsnprintf(buf, LOGLINEMAX-1, format, va); va_end(va); /* We can not use the return value vsnprintf() to determine where * to null terminate. The C99 standard specifies that vsnprintf() @@ -226,7 +226,7 @@ void chatout(const char *format, ...) va_start(va, format); - egg_vsnprintf(s, 511, format, va); + vsnprintf(s, 511, format, va); va_end(va); len = strlen(s); if (len > 511) @@ -251,7 +251,7 @@ void chanout_but(int x, int chan, const char *format, ...) va_start(va, format); - egg_vsnprintf(s, 511, format, va); + vsnprintf(s, 511, format, va); va_end(va); len = strlen(s); if (len > 511) diff --git a/src/eggdrop.h b/src/eggdrop.h index 964a63c28..a481c771b 100644 --- a/src/eggdrop.h +++ b/src/eggdrop.h @@ -281,6 +281,7 @@ typedef uint32_t IP; #define egg_strcasecmp strcasecmp #define egg_strftime strftime #define egg_strncasecmp strncasecmp +#define egg_vsnprintf vsnprintf #define my_memcpy memcpy /***********************************************************************/ diff --git a/src/misc.c b/src/misc.c index 990a3824a..7efb0f802 100644 --- a/src/misc.c +++ b/src/misc.c @@ -541,7 +541,7 @@ void putlog (int type, char *chname, const char *format, ...) /* No need to check if out should be null-terminated here, * just do it! */ - egg_vsnprintf(out, LOGLINEMAX - tsl, format, va); + vsnprintf(out, LOGLINEMAX - tsl, format, va); out[LOGLINEMAX - tsl] = 0; if (keep_all_logs) { if (!logfile_suffix[0]) diff --git a/src/mod/module.h b/src/mod/module.h index ca7f4081e..b9433cec5 100644 --- a/src/mod/module.h +++ b/src/mod/module.h @@ -63,9 +63,6 @@ #ifdef egg_inet_aton # undef egg_inet_aton #endif -#ifdef egg_vsnprintf -# undef egg_vsnprintf -#endif #ifdef egg_snprintf # undef egg_snprintf #endif @@ -425,7 +422,7 @@ typedef void (*chanout_butfunc)(int, int, const char *, ...) ATTRIBUTE_FORMAT(pr #define egg_inet_aton ((int (*)(const char *cp, struct in_addr *addr))global[251]) /* 252 - 255 */ #define egg_snprintf (global[252]) -#define egg_vsnprintf ((int (*)(char *, size_t, const char *, va_list))global[253]) +/* was egg_vsnprintf -- use vsnprintf() instead */ /* was egg_memset -- use memset() instead */ /* was egg_strcasecmp -- use strcasecmp instead */ /* 256 - 259 */ diff --git a/src/mod/share.mod/share.c b/src/mod/share.mod/share.c index 9e7bc519a..e9d50aba4 100644 --- a/src/mod/share.mod/share.c +++ b/src/mod/share.mod/share.c @@ -1473,7 +1473,7 @@ static void shareout_mod(struct chanset_t *chan, const char *format, ...) va_start(va, format); strcpy(s, "s "); - if ((l = egg_vsnprintf(s + 2, 509, format, va)) < 0) + if ((l = vsnprintf(s + 2, 509, format, va)) < 0) s[2 + (l = 509)] = 0; for (i = 0; i < dcc_total; i++) if ((dcc[i].type->flags & DCT_BOT) && @@ -1503,7 +1503,7 @@ static void shareout_but(struct chanset_t *chan, int x, const char *format, ...) va_start(va, format); strcpy(s, "s "); - if ((l = egg_vsnprintf(s + 2, 509, format, va)) < 0) + if ((l = vsnprintf(s + 2, 509, format, va)) < 0) s[2 + (l = 509)] = 0; for (i = 0; i < dcc_total; i++) if ((dcc[i].type->flags & DCT_BOT) && (i != x) && diff --git a/src/modules.c b/src/modules.c index b8368944f..e58851be2 100644 --- a/src/modules.c +++ b/src/modules.c @@ -521,7 +521,7 @@ Function global_table[] = { (Function) egg_inet_aton, /* 252 - 255 */ (Function) egg_snprintf, - (Function) egg_vsnprintf, + (Function) 0, /* was egg_vsnprintf -- use vsnprintf instead */ (Function) 0, /* was egg_memset -- use memset() or egg_bzero() instead */ (Function) 0, /* was egg_strcasecmp -- use strcasecmp() instead */ /* 256 - 259 */ From 534295c2d81f1e0bda688b24a4759cf12d72c7fc Mon Sep 17 00:00:00 2001 From: Michael Ortmann Date: Mon, 6 May 2024 18:03:04 +0200 Subject: [PATCH 2/2] Keep binary mod compatibility --- src/compat/snprintf.c | 2 +- src/eggdrop.h | 1 - src/modules.c | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/compat/snprintf.c b/src/compat/snprintf.c index bc65e97ec..c3ac80122 100644 --- a/src/compat/snprintf.c +++ b/src/compat/snprintf.c @@ -105,7 +105,7 @@ va_dcl VA_SHIFT(count, size_t); VA_SHIFT(fmt, char *); - (void) egg_vsnprintf(str, count, fmt, ap); + (void) vsnprintf(str, count, fmt, ap); VA_END; return (strlen(str)); } diff --git a/src/eggdrop.h b/src/eggdrop.h index af796b858..cca60c09a 100644 --- a/src/eggdrop.h +++ b/src/eggdrop.h @@ -274,7 +274,6 @@ typedef uint32_t IP; #define egg_strcasecmp strcasecmp #define egg_strftime strftime #define egg_strncasecmp strncasecmp -#define egg_vsnprintf vsnprintf #define my_memcpy memcpy /***********************************************************************/ diff --git a/src/modules.c b/src/modules.c index 3e0a97675..708252b04 100644 --- a/src/modules.c +++ b/src/modules.c @@ -523,7 +523,7 @@ Function global_table[] = { (Function) egg_inet_aton, /* 252 - 255 */ (Function) egg_snprintf, - (Function) 0, /* was egg_vsnprintf -- use vsnprintf instead */ + (Function) vsnprintf, /* was egg_vsnprintf -- use vsnprintf instead */ (Function) 0, /* was egg_memset -- use memset() or egg_bzero() instead */ (Function) 0, /* was egg_strcasecmp -- use strcasecmp() instead */ /* 256 - 259 */