]> jfr.im git - solanum.git/commitdiff
myctime -> rb_ctime
authorValery Yatsko <redacted>
Sun, 20 Apr 2008 05:03:39 +0000 (09:03 +0400)
committerValery Yatsko <redacted>
Sun, 20 Apr 2008 05:03:39 +0000 (09:03 +0400)
include/irc_string.h
modules/m_info.c
modules/m_whowas.c
src/client.c
src/irc_string.c

index 311189701a5997ff6e1983f24cca9ea4875bc71a..9c93edac9ebfc3cd692885f6f17569ac975257dc 100644 (file)
@@ -95,8 +95,6 @@ char *strip_colour(char *string);
  */
 char *strip_tabs(char *dest, const unsigned char *src, size_t len);
 
-const char *myctime(time_t);
-
 #define EmptyString(x) ((x) == NULL || *(x) == '\0')
 #define CheckEmpty(x) EmptyString(x) ? "" : x
 
index 3916eaeb9ab507c1409247a55888945315e50e5c..470ded5aa0369e3d567dfbd9308c92f170c85b92 100644 (file)
@@ -670,13 +670,14 @@ send_info_text(struct Client *source_p)
 static void
 send_birthdate_online_time(struct Client *source_p)
 {
+       char tbuf[26]; /* this needs to be 26 - see ctime_r manpage */
        sendto_one(source_p, ":%s %d %s :Birth Date: %s, compile # %s",
                   get_id(&me, source_p), RPL_INFO, 
                   get_id(source_p, source_p), creation, generation);
 
        sendto_one(source_p, ":%s %d %s :On-line since %s",
                   get_id(&me, source_p), RPL_INFO, 
-                  get_id(source_p, source_p), myctime(startup_time));
+                  get_id(source_p, source_p), rb_ctime(startup_time, tbuf, sizeof(tbuf)));
 }
 
 /*
index 807f84a5d511f44364bd076a247b8a99d355f51e..0728a80e95af2d0cd7ecdfb533075d8324fe1eb8 100644 (file)
@@ -64,6 +64,7 @@ m_whowas(struct Client *client_p, struct Client *source_p, int parc, const char
        int max = -1, found = 0;
        char *p;
        const char *nick;
+       char tbuf[26];
 
        static time_t last_used = 0L;
 
@@ -118,7 +119,7 @@ m_whowas(struct Client *client_p, struct Client *source_p, int parc, const char
                        sendto_one_numeric(source_p, RPL_WHOISSERVER,
                                           form_str(RPL_WHOISSERVER),
                                           temp->name, temp->servername,
-                                          myctime(temp->logoff));
+                                          rb_ctime(temp->logoff, tbuf, sizeof(tbuf)));
                        cur++;
                        found++;
                }
index 497a7b63aad041d5f0e4d0b33205d5db95e3f7f5..903391d0a7752ce757f77c8d5ad5e50c191e1b4b 100644 (file)
@@ -1512,6 +1512,7 @@ exit_local_client(struct Client *client_p, struct Client *source_p, struct Clien
                  const char *comment)
 {
        unsigned long on_for;
+       char tbuf[26];
 
        exit_generic_client(client_p, source_p, from, comment);
        clear_monitor(source_p);
@@ -1538,7 +1539,7 @@ exit_local_client(struct Client *client_p, struct Client *source_p, struct Clien
        on_for = rb_current_time() - source_p->localClient->firsttime;
 
        ilog(L_USER, "%s (%3lu:%02lu:%02lu): %s!%s@%s %d/%d",
-               myctime(rb_current_time()), on_for / 3600,
+               rb_ctime(rb_current_time(), tbuf, sizeof(tbuf)), on_for / 3600,
                (on_for % 3600) / 60, on_for % 60,
                source_p->name, source_p->username, source_p->host,
                source_p->localClient->sendK, source_p->localClient->receiveK);
index d47147d297bf78cf6050f9e72a76183321b587ec..fecd3d14d10a64eb63ea02166295fce890e955a3 100644 (file)
 #include "client.h"
 #include "setup.h"
 
-#ifndef INADDRSZ
-#define INADDRSZ 4
-#endif
-
-#ifdef RB_IPV6
-#ifndef IN6ADDRSZ
-#define IN6ADDRSZ 16
-#endif
-#endif
-
 #ifndef INT16SZ
 #define INT16SZ 2
 #endif
-/*
- * 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;
-
-       strcpy(buf, ctime(&value));
-       if((p = strchr(buf, '\n')) != NULL)
-               *p = '\0';
-       return buf;
-}
-
 
 /*
  * clean_string - clean up a string possibly containing garbage