From 159f69218dfbfc25dda011367da71826a97ca424 Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 31 Jan 2014 11:23:59 +0000 Subject: - Move myctime() from irc_string.c to s_misc.c git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2971 82007160-df01-0410-b94d-b575c5fd34c7 --- src/irc_string.c | 25 ------------------------- src/s_misc.c | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-) (limited to 'src') 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 @@ -48,31 +48,6 @@ has_wildcards(const char *str) return 0; } -/* - * 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) * 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) -- cgit