From 45a85404bf6e7707794931a8e6b5f8fe7e2e306c Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sun, 29 Jan 2006 20:35:18 +0000 Subject: [PATCH] Small fix for Sparc --- mbtask/taskibc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mbtask/taskibc.c b/mbtask/taskibc.c index 63852a7d..5c3abce9 100644 --- a/mbtask/taskibc.c +++ b/mbtask/taskibc.c @@ -203,6 +203,7 @@ void dump_ncslist(void) chn_list *chnp; char temp1[128], temp2[128], buf[21]; struct tm ptm; + time_t tnow; if (!callchg && !srvchg && !usrchg && !chnchg && !banchg && !nickchg) return; @@ -230,7 +231,8 @@ void dump_ncslist(void) for (srv = servers; srv; srv = srv->next) { snprintf(temp1, 25, "%s", srv->server); snprintf(temp2, 25, "%s", srv->router); - localtime_r(&srv->connected, &ptm); + tnow = (time_t)srv->connected; + localtime_r(&tnow, &ptm); snprintf(buf, 21, "%02d-%s-%04d %02d:%02d:%02d", ptm.tm_mday, mon[ptm.tm_mon], ptm.tm_year+1900, ptm.tm_hour, ptm.tm_min, ptm.tm_sec); Syslog('+', "IBC: %-25s %-25s %5d %5d %s", temp1, temp2, srv->hops, srv->users, buf); @@ -247,7 +249,8 @@ void dump_ncslist(void) for (usrp = users; usrp; usrp = usrp->next) { snprintf(temp1, 20, "%s", usrp->server); snprintf(temp2, 20, "%s", usrp->realname); - localtime_r(&usrp->connected, &ptm); + tnow = (time_t)usrp->connected; + localtime_r(&tnow, &ptm); snprintf(buf, 21, "%02d-%s-%04d %02d:%02d:%02d", ptm.tm_mday, mon[ptm.tm_mon], ptm.tm_year+1900, ptm.tm_hour, ptm.tm_min, ptm.tm_sec); Syslog('+', "IBC: %-20s %-20s %-9s %-13s %s %s", temp1, temp2, usrp->nick, usrp->channel, @@ -263,7 +266,8 @@ void dump_ncslist(void) Syslog('+', "IBC: Channel Owner Topic Usr Created"); Syslog('+', "IBC: -------------------- --------- ----------------------------------- --- --------------------"); for (chnp = channels; chnp; chnp = chnp->next) { - localtime_r(&chnp->created, &ptm); + tnow = (time_t)chnp->created; + localtime_r(&tnow, &ptm); snprintf(buf, 21, "%02d-%s-%04d %02d:%02d:%02d", ptm.tm_mday, mon[ptm.tm_mon], ptm.tm_year+1900, ptm.tm_hour, ptm.tm_min, ptm.tm_sec); Syslog('+', "IBC: %-20s %-9s %-35s %3d %s", chnp->name, chnp->owner, chnp->topic, chnp->users, buf);