diff options
-rw-r--r-- | include/irc_string.h | 2 | ||||
-rw-r--r-- | include/s_misc.h | 1 | ||||
-rw-r--r-- | modules/m_info.c | 1 | ||||
-rw-r--r-- | modules/m_whowas.c | 1 | ||||
-rw-r--r-- | src/irc_string.c | 25 | ||||
-rw-r--r-- | src/s_misc.c | 25 |
6 files changed, 28 insertions, 27 deletions
diff --git a/include/irc_string.h b/include/irc_string.h index 8f7f00a..e407447 100644 --- a/include/irc_string.h +++ b/include/irc_string.h @@ -70,8 +70,6 @@ extern const char *libio_basename(const char *); */ extern void strip_tabs(char *, const char *, size_t); -const char *myctime(time_t); - #define EmptyString(x) (!(x) || (*(x) == '\0')) #ifndef HAVE_STRTOK_R diff --git a/include/s_misc.h b/include/s_misc.h index 53b9f1e..9876533 100644 --- a/include/s_misc.h +++ b/include/s_misc.h @@ -29,6 +29,7 @@ extern const char *date(time_t); extern const char *smalldate(time_t); +extern const char *myctime(time_t); #ifdef HAVE_LIBCRYPTO extern const char *ssl_get_cipher(const SSL *); #endif diff --git a/modules/m_info.c b/modules/m_info.c index 1c0b8a9..dc97312 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -31,6 +31,7 @@ #include "irc_string.h" #include "ircd.h" #include "numeric.h" +#include "s_misc.h" #include "s_serv.h" #include "s_user.h" #include "send.h" diff --git a/modules/m_whowas.c b/modules/m_whowas.c index 02c43e8..62115e8 100644 --- a/modules/m_whowas.c +++ b/modules/m_whowas.c @@ -33,6 +33,7 @@ #include "ircd.h" #include "ircd_defs.h" #include "numeric.h" +#include "s_misc.h" #include "s_serv.h" #include "s_user.h" #include "send.h" diff --git a/src/irc_string.c b/src/irc_string.c index 3ad8f93..4ba1057 100644 --- a/src/irc_string.c +++ b/src/irc_string.c @@ -49,31 +49,6 @@ has_wildcards(const char *str) } /* - * myctime - This is like standard ctime()-function, but it zaps away - * the newline from the end of that string. Also, it takes - * the time value as parameter, instead of pointer to it. - * Note that it is necessary to copy the string to alternate - * buffer (who knows how ctime() implements it, maybe it statically - * has newline there and never 'refreshes' it -- zapping that - * might break things in other places...) - * - * - * Thu Nov 24 18:22:48 1986 - */ -const char * -myctime(time_t value) -{ - static char buf[32]; - char *p; - - strlcpy(buf, ctime(&value), sizeof(buf)); - - if ((p = strchr(buf, '\n')) != NULL) - *p = '\0'; - return buf; -} - -/* * strip_tabs(dst, src, length) * * Copies src to dst, while converting all \t (tabs) into spaces. diff --git a/src/s_misc.c b/src/s_misc.c index 005fac8..855b91a 100644 --- a/src/s_misc.c +++ b/src/s_misc.c @@ -115,6 +115,31 @@ smalldate(time_t lclock) return buf; } +/* + * myctime - This is like standard ctime()-function, but it zaps away + * the newline from the end of that string. Also, it takes + * the time value as parameter, instead of pointer to it. + * Note that it is necessary to copy the string to alternate + * buffer (who knows how ctime() implements it, maybe it statically + * has newline there and never 'refreshes' it -- zapping that + * might break things in other places...) + * + * + * Thu Nov 24 18:22:48 1986 + */ +const char * +myctime(time_t value) +{ + static char buf[32]; + char *p; + + strlcpy(buf, ctime(&value), sizeof(buf)); + + if ((p = strchr(buf, '\n')) != NULL) + *p = '\0'; + return buf; +} + #ifdef HAVE_LIBCRYPTO const char * ssl_get_cipher(const SSL *ssl) |