Skip to content
Permalink
Browse files

Replace compat egg_strftime() with strftime()

Patch by: michaelortmann

* strftime() is posix 2001, cleanup compat, egg_strftime() -> strftime()
* delete mbrlen check, for it was only needed by compat/gnu_strftime.c
* Update docs
  • Loading branch information...
michaelortmann authored and vanosg committed Jun 28, 2019
1 parent c763e7e commit c0e69988d6dd892e27b6b4a410f35d8d8156e3eb
@@ -111,10 +111,9 @@ AX_TYPE_SOCKLEN_T
AX_CREATE_STDINT_H([eggint.h])

# Checks for functions and their arguments.
AC_CHECK_FUNCS([clock dprintf fsync getrandom getrusage inet_aton inet_ntop isascii mbrlen random rand lrand48 rename setpgid sigaction sigemptyset snprintf strcasecmp strlcpy strncasecmp uname vsnprintf])
AC_CHECK_FUNCS([clock dprintf fsync getrandom getrusage inet_aton inet_ntop isascii random rand lrand48 rename setpgid sigaction sigemptyset snprintf strcasecmp strlcpy strncasecmp uname vsnprintf])
AC_FUNC_SELECT_ARGTYPES
EGG_FUNC_VPRINTF
AC_FUNC_STRFTIME
AC_FUNC_MMAP


@@ -2200,7 +2200,7 @@ duration <seconds>
strftime <formatstring> [time]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Returns: a formatted string of time using standard strftime format. If time is specified, the value of the specified time is used. Otherwise, the current time is used.
Returns: a formatted string of time using standard strftime format. If time is specified, the value of the specified time is used. Otherwise, the current time is used. Note: The implementation of strftime varies from platform to platform, so the user should only use POSIX-compliant format specifiers to ensure fully portable code.

Module: core

@@ -85,168 +85,154 @@ eggdrop.h:
bg.o: bg.c main.h ../config.h ../eggint.h ../lush.h lang.h eggdrop.h \
compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h tclhash.h \
chan.h users.h compat/compat.h compat/inet_aton.h ../src/main.h \
compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h bg.h
compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h bg.h
botcmd.o: botcmd.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h tandem.h modules.h mod/modvals.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h tandem.h \
modules.h mod/modvals.h
botmsg.o: botmsg.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h tandem.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h tandem.h
botnet.o: botnet.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h tandem.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h tandem.h
chanprog.o: chanprog.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h modules.h mod/modvals.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h modules.h \
mod/modvals.h
cmds.o: cmds.c main.h ../config.h ../eggint.h ../lush.h lang.h eggdrop.h \
compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h tclhash.h \
chan.h users.h compat/compat.h compat/inet_aton.h ../src/main.h \
compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h tandem.h modules.h mod/modvals.h
compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h tandem.h \
modules.h mod/modvals.h
dcc.o: dcc.c main.h ../config.h ../eggint.h ../lush.h lang.h eggdrop.h \
compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h tclhash.h \
chan.h users.h compat/compat.h compat/inet_aton.h ../src/main.h \
compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h modules.h mod/modvals.h tandem.h md5/md5.h
compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h modules.h \
mod/modvals.h tandem.h md5/md5.h
dccutil.o: dccutil.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h modules.h mod/modvals.h tandem.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h modules.h \
mod/modvals.h tandem.h
dns.o: dns.c main.h ../config.h ../eggint.h ../lush.h lang.h eggdrop.h \
compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h tclhash.h \
chan.h users.h compat/compat.h compat/inet_aton.h ../src/main.h \
compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h dns.h
compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h dns.h
flags.o: flags.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h
language.o: language.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h
main.o: main.c ../config.h main.h ../eggint.h ../lush.h lang.h eggdrop.h \
compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h tclhash.h \
chan.h users.h compat/compat.h compat/inet_aton.h ../src/main.h \
compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h version.h modules.h mod/modvals.h tandem.h bg.h
compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h version.h \
modules.h mod/modvals.h tandem.h bg.h
match.o: match.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h
mem.o: mem.c main.h ../config.h ../eggint.h ../lush.h lang.h eggdrop.h \
compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h tclhash.h \
chan.h users.h compat/compat.h compat/inet_aton.h ../src/main.h \
compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h mod/modvals.h
compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h \
mod/modvals.h
misc.o: misc.c main.h ../config.h ../eggint.h ../lush.h lang.h eggdrop.h \
compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h tclhash.h \
chan.h users.h compat/compat.h compat/inet_aton.h ../src/main.h \
compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h tandem.h modules.h mod/modvals.h stat.h
compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h tandem.h \
modules.h mod/modvals.h stat.h
misc_file.o: misc_file.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h stat.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h stat.h
modules.o: modules.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h modules.h mod/modvals.h tandem.h md5/md5.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h modules.h \
mod/modvals.h tandem.h md5/md5.h
net.o: net.c main.h ../config.h ../eggint.h ../lush.h lang.h eggdrop.h \
compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h tclhash.h \
chan.h users.h compat/compat.h compat/inet_aton.h ../src/main.h \
compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h
compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h
rfc1459.o: rfc1459.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h
tcl.o: tcl.c main.h ../config.h ../eggint.h ../lush.h lang.h eggdrop.h \
compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h tclhash.h \
chan.h users.h compat/compat.h compat/inet_aton.h ../src/main.h \
compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h
compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h
tcldcc.o: tcldcc.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h tandem.h modules.h mod/modvals.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h tandem.h \
modules.h mod/modvals.h
tclhash.o: tclhash.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h
tclmisc.o: tclmisc.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h modules.h mod/modvals.h tandem.h md5/md5.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h modules.h \
mod/modvals.h tandem.h md5/md5.h
tcluser.o: tcluser.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h tandem.h modules.h mod/modvals.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h tandem.h \
modules.h mod/modvals.h
tls.o: tls.c main.h ../config.h ../eggint.h ../lush.h lang.h eggdrop.h \
compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h tclhash.h \
chan.h users.h compat/compat.h compat/inet_aton.h ../src/main.h \
compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h
compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h
userent.o: userent.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h
userrec.o: userrec.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h modules.h mod/modvals.h tandem.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h modules.h \
mod/modvals.h tandem.h
users.o: users.c main.h ../config.h ../eggint.h ../lush.h lang.h \
eggdrop.h compat/in6.h flags.h proto.h misc_file.h cmdt.h tclegg.h \
tclhash.h chan.h users.h compat/compat.h compat/inet_aton.h \
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/strftime.h \
compat/inet_ntop.h compat/inet_pton.h compat/gethostbyname2.h \
compat/strlcpy.h modules.h mod/modvals.h tandem.h
../src/main.h compat/snprintf.h compat/strcasecmp.h compat/inet_ntop.h \
compat/inet_pton.h compat/gethostbyname2.h compat/strlcpy.h modules.h \
mod/modvals.h tandem.h
@@ -163,7 +163,7 @@ static void tell_who(struct userrec *u, int idx, int chan)
ok = 1;
dprintf(idx, "Bots connected:\n");
}
egg_strftime(s, 14, "%d %b %H:%M", localtime(&dcc[i].timeval));
strftime(s, 14, "%d %b %H:%M", localtime(&dcc[i].timeval));
if (atr & USER_OWNER) {
egg_snprintf(format, sizeof format,
" [%%.2lu] %%s%%c%%-%us (%%s) %%s\n", nicklen);

0 comments on commit c0e6998

Please sign in to comment.
You can’t perform that action at this time.