[cvslog] (2006-11-25 13:14:42 UTC) Module eggdrop1.7: Change committed!

cvslog cvs at tsss.org
Sat Nov 25 07:14:45 CST 2006


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2006-11-25 13:14:42 UTC
Commited by: Tothwolf <tothwolf at techmonkeys.org>

Modified files:
     src/dcc.c src/tcldcc.c src/tcluser.c src/userent.c src/userfile.c
     src/userrec.c src/mod/channels.mod/tclchan.c
     src/mod/channels.mod/userchan.c src/mod/filesys.mod/filesys.c

Log message:

* Fixed compatibility problems with certain time_t implementations.

---------------------- diff included ----------------------
Index: eggdrop1.7/src/dcc.c
diff -u eggdrop1.7/src/dcc.c:1.17 eggdrop1.7/src/dcc.c:1.18
--- eggdrop1.7/src/dcc.c:1.17	Mon Nov 20 07:53:33 2006
+++ eggdrop1.7/src/dcc.c	Sat Nov 25 07:14:31 2006
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: dcc.c,v 1.17 2006-11-20 13:53:33 tothwolf Exp $
+ * $Id: dcc.c,v 1.18 2006-11-25 13:14:31 tothwolf Exp $
  */
 
 #include "main.h"
@@ -372,7 +372,10 @@
 
 static void display_dcc_bot_new(int idx, char *buf)
 {
-  sprintf(buf, "bot*  waited %lis", now - dcc[idx].timeval);
+  long tv;
+
+  tv = now - dcc[idx].timeval;
+  sprintf(buf, "bot*  waited %lis", tv);
 }
 
 static int expmem_dcc_bot_(void *x)
@@ -642,7 +645,10 @@
 
 static void display_dcc_chat_pass(int idx, char *buf)
 {
-  sprintf(buf, "pass  waited %lis", now - dcc[idx].timeval);
+  long tv;
+
+  tv = now - dcc[idx].timeval;
+  sprintf(buf, "pass  waited %lis", tv);
 }
 
 static int expmem_dcc_general(void *x)
@@ -1499,7 +1505,10 @@
 
 static void display_dcc_telnet_id(int idx, char *buf)
 {
-  sprintf(buf, "t-in  waited %lis", now - dcc[idx].timeval);
+  long tv;
+
+  tv = now - dcc[idx].timeval;
+  sprintf(buf, "t-in  waited %lis", tv);
 }
 
 struct dcc_table DCC_TELNET_ID = {
@@ -1662,12 +1671,18 @@
 
 static void display_dcc_telnet_new(int idx, char *buf)
 {
-  sprintf(buf, "new   waited %lis", now - dcc[idx].timeval);
+  long tv;
+
+  tv = now - dcc[idx].timeval;
+  sprintf(buf, "new   waited %lis", tv);
 }
 
 static void display_dcc_telnet_pw(int idx, char *buf)
 {
-  sprintf(buf, "newp  waited %lis", now - dcc[idx].timeval);
+  long tv;
+
+  tv = now - dcc[idx].timeval;
+  sprintf(buf, "newp  waited %lis", tv);
 }
 
 struct dcc_table DCC_TELNET_NEW = {
@@ -1897,7 +1912,10 @@
 
 static void display_dcc_identwait(int idx, char *buf)
 {
-  sprintf(buf, "idtw  waited %lis", now - dcc[idx].timeval);
+  long tv;
+
+  tv = now - dcc[idx].timeval;
+  sprintf(buf, "idtw  waited %lis", tv);
 }
 
 struct dcc_table DCC_IDENTWAIT = {
Index: eggdrop1.7/src/mod/channels.mod/tclchan.c
diff -u eggdrop1.7/src/mod/channels.mod/tclchan.c:1.7 eggdrop1.7/src/mod/channels.mod/tclchan.c:1.8
--- eggdrop1.7/src/mod/channels.mod/tclchan.c:1.7	Mon Nov 20 07:53:38 2006
+++ eggdrop1.7/src/mod/channels.mod/tclchan.c	Sat Nov 25 07:14:32 2006
@@ -1,7 +1,7 @@
 /*
  * tclchan.c -- part of channels.mod
  *
- * $Id: tclchan.c,v 1.7 2006-11-20 13:53:38 tothwolf Exp $
+ * $Id: tclchan.c,v 1.8 2006-11-25 13:14:32 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1494,17 +1494,25 @@
 static int tcl_do_masklist(maskrec *m, Tcl_Interp *irp)
 {
   char ts[21], ts1[21], ts2[21], *p;
+  long tv;
   EGG_CONST char *list[6];
 
   for (; m; m = m->next) {
     list[0] = m->mask;
     list[1] = m->desc;
-    sprintf(ts, "%lu", m->expire);
+
+    tv = m->expire;
+    sprintf(ts, "%lu", tv);
     list[2] = ts;
-    sprintf(ts1, "%lu", m->added);
+
+    tv = m->added;
+    sprintf(ts1, "%lu", tv);
     list[3] = ts1;
-    sprintf(ts2, "%lu", m->lastactive);
+
+    tv = m->lastactive;
+    sprintf(ts2, "%lu", tv);
     list[4] = ts2;
+
     list[5] = m->user;
     p = Tcl_Merge(6, list);
     Tcl_AppendElement(irp, p);
Index: eggdrop1.7/src/mod/channels.mod/userchan.c
diff -u eggdrop1.7/src/mod/channels.mod/userchan.c:1.4 eggdrop1.7/src/mod/channels.mod/userchan.c:1.5
--- eggdrop1.7/src/mod/channels.mod/userchan.c:1.4	Mon Nov 20 07:53:38 2006
+++ eggdrop1.7/src/mod/channels.mod/userchan.c	Sat Nov 25 07:14:32 2006
@@ -1,7 +1,7 @@
 /*
  * userchan.c -- part of channels.mod
  *
- * $Id: userchan.c,v 1.4 2006-11-20 13:53:38 tothwolf Exp $
+ * $Id: userchan.c,v 1.5 2006-11-25 13:14:32 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1082,16 +1082,19 @@
   struct chanset_t *chan;
   maskrec *b;
   char *mask;
+  long expire, added;
 
   if (global_bans)
     if (fprintf(f, BAN_NAME " - -\n") == EOF)   /* Daemus */
       return 0;
   for (b = global_bans; b; b = b->next) {
     mask = str_escape(b->mask, ':', '\\');
+    expire = b->expire;
+    added = b->added;
     if (!mask ||
         fprintf(f, "- %s:%s%lu%s:+%lu:%lu:%s:%s\n", mask,
-                (b->flags & MASKREC_PERM) ? "+" : "", b->expire,
-                (b->flags & MASKREC_STICKY) ? "*" : "", b->added,
+                (b->flags & MASKREC_PERM) ? "+" : "", expire,
+                (b->flags & MASKREC_STICKY) ? "*" : "", added,
                 b->lastactive, b->user ? b->user : botnetnick,
                 b->desc ? b->desc : "requested") == EOF) {
       if (mask)
@@ -1113,10 +1116,12 @@
           return 0;
         for (b = chan->bans; b; b = b->next) {
           mask = str_escape(b->mask, ':', '\\');
+          expire = b->expire;
+          added = b->added;
           if (!mask ||
               fprintf(f, "- %s:%s%lu%s:+%lu:%lu:%s:%s\n", mask,
-                      (b->flags & MASKREC_PERM) ? "+" : "", b->expire,
-                      (b->flags & MASKREC_STICKY) ? "*" : "", b->added,
+                      (b->flags & MASKREC_PERM) ? "+" : "", expire,
+                      (b->flags & MASKREC_STICKY) ? "*" : "", added,
                       b->lastactive, b->user ? b->user : botnetnick,
                       b->desc ? b->desc : "requested") == EOF) {
             if (mask)
@@ -1137,16 +1142,19 @@
   struct chanset_t *chan;
   maskrec *e;
   char *mask;
+  long expire, added;
 
   if (global_exempts)
     if (fprintf(f, EXEMPT_NAME " - -\n") == EOF)        /* Daemus */
       return 0;
   for (e = global_exempts; e; e = e->next) {
     mask = str_escape(e->mask, ':', '\\');
+    expire = e->expire;
+    added = e->added;
     if (!mask ||
         fprintf(f, "%s %s:%s%lu%s:+%lu:%lu:%s:%s\n", "%", mask,
-                (e->flags & MASKREC_PERM) ? "+" : "", e->expire,
-                (e->flags & MASKREC_STICKY) ? "*" : "", e->added,
+                (e->flags & MASKREC_PERM) ? "+" : "", expire,
+                (e->flags & MASKREC_STICKY) ? "*" : "", added,
                 e->lastactive, e->user ? e->user : botnetnick,
                 e->desc ? e->desc : "requested") == EOF) {
       if (mask)
@@ -1168,10 +1176,12 @@
           return 0;
         for (e = chan->exempts; e; e = e->next) {
           mask = str_escape(e->mask, ':', '\\');
+          expire = e->expire;
+          added = e->added;
           if (!mask ||
               fprintf(f, "%s %s:%s%lu%s:+%lu:%lu:%s:%s\n", "%", mask,
-                      (e->flags & MASKREC_PERM) ? "+" : "", e->expire,
-                      (e->flags & MASKREC_STICKY) ? "*" : "", e->added,
+                      (e->flags & MASKREC_PERM) ? "+" : "", expire,
+                      (e->flags & MASKREC_STICKY) ? "*" : "", added,
                       e->lastactive, e->user ? e->user : botnetnick,
                       e->desc ? e->desc : "requested") == EOF) {
             if (mask)
@@ -1192,16 +1202,19 @@
   struct chanset_t *chan;
   maskrec *ir;
   char *mask;
+  long expire, added;
 
   if (global_invites)
     if (fprintf(f, INVITE_NAME " - -\n") == EOF)        /* Daemus */
       return 0;
   for (ir = global_invites; ir; ir = ir->next) {
     mask = str_escape(ir->mask, ':', '\\');
+    expire = ir->expire;
+    added = ir->added;
     if (!mask ||
         fprintf(f, "@ %s:%s%lu%s:+%lu:%lu:%s:%s\n", mask,
-                (ir->flags & MASKREC_PERM) ? "+" : "", ir->expire,
-                (ir->flags & MASKREC_STICKY) ? "*" : "", ir->added,
+                (ir->flags & MASKREC_PERM) ? "+" : "", expire,
+                (ir->flags & MASKREC_STICKY) ? "*" : "", added,
                 ir->lastactive, ir->user ? ir->user : botnetnick,
                 ir->desc ? ir->desc : "requested") == EOF) {
       if (mask)
@@ -1223,10 +1236,12 @@
           return 0;
         for (ir = chan->invites; ir; ir = ir->next) {
           mask = str_escape(ir->mask, ':', '\\');
+          expire = ir->expire;
+          added = ir->added;
           if (!mask ||
               fprintf(f, "@ %s:%s%lu%s:+%lu:%lu:%s:%s\n", mask,
-                      (ir->flags & MASKREC_PERM) ? "+" : "", ir->expire,
-                      (ir->flags & MASKREC_STICKY) ? "*" : "", ir->added,
+                      (ir->flags & MASKREC_PERM) ? "+" : "", expire,
+                      (ir->flags & MASKREC_STICKY) ? "*" : "", added,
                       ir->lastactive, ir->user ? ir->user : botnetnick,
                       ir->desc ? ir->desc : "requested") == EOF) {
             if (mask)
Index: eggdrop1.7/src/mod/filesys.mod/filesys.c
diff -u eggdrop1.7/src/mod/filesys.mod/filesys.c:1.10 eggdrop1.7/src/mod/filesys.mod/filesys.c:1.11
--- eggdrop1.7/src/mod/filesys.mod/filesys.c:1.10	Mon Nov 20 07:53:41 2006
+++ eggdrop1.7/src/mod/filesys.mod/filesys.c	Sat Nov 25 07:14:32 2006
@@ -2,7 +2,7 @@
  * filesys.c -- part of filesys.mod
  *   main file of the filesys eggdrop module
  *
- * $Id: filesys.c,v 1.10 2006-11-20 13:53:41 tothwolf Exp $
+ * $Id: filesys.c,v 1.11 2006-11-25 13:14:32 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -552,7 +552,10 @@
 
 static void disp_dcc_files_pass(int idx, char *buf)
 {
-  sprintf(buf, "fpas  waited %lis", now - dcc[idx].timeval);
+  long tv;
+  tv = now - dcc[idx].timeval;
+
+  sprintf(buf, "fpas  waited %lis", tv);
 }
 
 static void kill_dcc_files(int idx, void *x)
Index: eggdrop1.7/src/tcldcc.c
diff -u eggdrop1.7/src/tcldcc.c:1.16 eggdrop1.7/src/tcldcc.c:1.17
--- eggdrop1.7/src/tcldcc.c:1.16	Mon Nov 20 07:53:35 2006
+++ eggdrop1.7/src/tcldcc.c	Sat Nov 25 07:14:31 2006
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: tcldcc.c,v 1.16 2006-11-20 13:53:35 tothwolf Exp $
+ * $Id: tcldcc.c,v 1.17 2006-11-25 13:14:31 tothwolf Exp $
  */
 
 #include "main.h"
@@ -641,6 +641,7 @@
 {
   int i;
   char *p, idxstr[10], timestamp[11], other[160];
+  long tv;
   EGG_CONST char *list[6];
 
   BADARGS(1, 2, " ?type?");
@@ -649,7 +650,8 @@
     if (argc == 1 || ((argc == 2) && (dcc[i].type &&
         !egg_strcasecmp(dcc[i].type->name, argv[1])))) {
       egg_snprintf(idxstr, sizeof idxstr, "%ld", dcc[i].sock);
-      egg_snprintf(timestamp, sizeof timestamp, "%ld", dcc[i].timeval);
+      tv = dcc[i].timeval;
+      egg_snprintf(timestamp, sizeof timestamp, "%ld", tv);
       if (dcc[i].type && dcc[i].type->display)
         dcc[i].type->display(i, other);
       else {
@@ -676,6 +678,7 @@
 {
   int chan, i;
   char c[2], idle[11], work[20], *p;
+  long tv = 0;
   EGG_CONST char *list[7];
 
   BADARGS(2, 2, " chan");
@@ -704,7 +707,8 @@
       if (dcc[i].u.chat->channel == chan || chan == -1) {
         c[0] = geticon(i);
         c[1] = 0;
-        egg_snprintf(idle, sizeof idle, "%li", (now - dcc[i].timeval) / 60);
+        tv = (now - dcc[i].timeval) / 60;
+        egg_snprintf(idle, sizeof idle, "%li", tv);
         list[0] = dcc[i].nick;
         list[1] = botnetnick;
         list[2] = dcc[i].host;
@@ -726,8 +730,10 @@
       c[1] = 0;
       if (party[i].timer == 0L)
         strcpy(idle, "0");
-      else
-        egg_snprintf(idle, sizeof idle, "%li", (now - party[i].timer) / 60);
+      else {
+        tv = (now - party[i].timer) / 60;
+        egg_snprintf(idle, sizeof idle, "%li", tv);
+      }
       list[0] = party[i].nick;
       list[1] = party[i].bot;
       list[2] = party[i].from ? party[i].from : "";
Index: eggdrop1.7/src/tcluser.c
diff -u eggdrop1.7/src/tcluser.c:1.12 eggdrop1.7/src/tcluser.c:1.13
--- eggdrop1.7/src/tcluser.c:1.12	Mon Nov 20 07:53:36 2006
+++ eggdrop1.7/src/tcluser.c	Sat Nov 25 07:14:31 2006
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: tcluser.c,v 1.12 2006-11-20 13:53:36 tothwolf Exp $
+ * $Id: tcluser.c,v 1.13 2006-11-25 13:14:31 tothwolf Exp $
  */
 
 #include "main.h"
@@ -501,6 +501,7 @@
                           int argc, char *argv[])
 {
   char expire[11], added[11], *p;
+  long tv;
   EGG_CONST char *list[5];
   struct igrec *i;
 
@@ -509,10 +510,15 @@
   for (i = global_ign; i; i = i->next) {
     list[0] = i->igmask;
     list[1] = i->msg;
-    egg_snprintf(expire, sizeof expire, "%lu", i->expire);
+
+    tv = i->expire;
+    egg_snprintf(expire, sizeof expire, "%lu", tv);
     list[2] = expire;
-    egg_snprintf(added, sizeof added, "%lu", i->added);
+
+    tv = i->added;
+    egg_snprintf(added, sizeof added, "%lu", tv);
     list[3] = added;
+
     list[4] = i->user;
     p = Tcl_Merge(5, list);
     Tcl_AppendElement(irp, p);
Index: eggdrop1.7/src/userent.c
diff -u eggdrop1.7/src/userent.c:1.12 eggdrop1.7/src/userent.c:1.13
--- eggdrop1.7/src/userent.c:1.12	Mon Nov 20 07:53:36 2006
+++ eggdrop1.7/src/userent.c	Sat Nov 25 07:14:32 2006
@@ -2,7 +2,7 @@
  * userent.c -- handles:
  *   user-entry handling, new stylem more versatile.
  *
- * $Id: userent.c,v 1.12 2006-11-20 13:53:36 tothwolf Exp $
+ * $Id: userent.c,v 1.13 2006-11-25 13:14:32 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -320,11 +320,13 @@
 static int laston_pack(struct userrec *u, struct user_entry *e)
 {
   char work[1024];
+  long tv;
   struct laston_info *li;
   int l;
 
   li = (struct laston_info *) e->u.extra;
-  l = sprintf(work, "%lu %s", li->laston, li->lastonplace);
+  tv = li->laston;
+  l = sprintf(work, "%lu %s", tv, li->lastonplace);
   e->u.list = user_malloc(sizeof(struct list_type));
   e->u.list->next = NULL;
   e->u.list->extra = user_malloc(l + 1);
@@ -337,9 +339,11 @@
 static int laston_write_userfile(FILE *f, struct userrec *u,
                                  struct user_entry *e)
 {
+  long tv;
   struct laston_info *li = (struct laston_info *) e->u.extra;
 
-  if (fprintf(f, "--LASTON %lu %s\n", li->laston,
+  tv = li->laston;
+  if (fprintf(f, "--LASTON %lu %s\n", tv,
               li->lastonplace ? li->lastonplace : "") == EOF)
     return 0;
   return 1;
@@ -375,6 +379,7 @@
 {
   struct laston_info *li = (struct laston_info *) e->u.extra;
   char number[20];
+  long tv;
   struct chanuserrec *cr;
 
   BADARGS(3, 4, " handle LASTON ?channel?");
@@ -388,7 +393,8 @@
     if (!cr)
       Tcl_AppendResult(irp, "0", NULL);
   } else {
-    sprintf(number, "%lu ", li->laston);
+    tv = li->laston;
+    sprintf(number, "%lu ", tv);
     Tcl_AppendResult(irp, number, li->lastonplace, NULL);
   }
   return TCL_OK;
Index: eggdrop1.7/src/userfile.c
diff -u eggdrop1.7/src/userfile.c:1.4 eggdrop1.7/src/userfile.c:1.5
--- eggdrop1.7/src/userfile.c:1.4	Mon Nov 20 07:53:36 2006
+++ eggdrop1.7/src/userfile.c	Sat Nov 25 07:14:32 2006
@@ -18,7 +18,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: userfile.c,v 1.4 2006-11-20 13:53:36 tothwolf Exp $
+ * $Id: userfile.c,v 1.5 2006-11-25 13:14:32 tothwolf Exp $
  */
 
 
@@ -493,6 +493,7 @@
   struct user_entry *ue;
   struct flag_record fr = { FR_GLOBAL, 0, 0, 0, 0, 0 };
   char s[181];
+  long tv;
 
   fr.global = u->flags;
   fr.udef_global = u->flags_udef;
@@ -513,7 +514,8 @@
         fr.chan = ch->flags;
         fr.udef_chan = ch->flags_udef;
         build_flags(s, &fr, NULL);
-        if (fprintf(f, "! %-20s %lu %-10s %s\n", ch->channel, ch->laston, s,
+        tv = ch->laston;
+        if (fprintf(f, "! %-20s %lu %-10s %s\n", ch->channel, tv, s,
             ((idx < 0 || share_greet) && ch->info) ? ch->info : "") == EOF)
           return 0;
       }
@@ -538,15 +540,18 @@
 {
   struct igrec *i;
   char *mask;
+  long expire, added;
 
   if (global_ign && fprintf(f, IGNORE_NAME " - -\n") == EOF)
     return 0;
 
   for (i = global_ign; i; i = i->next) {
     mask = str_escape(i->igmask, ':', '\\');
+    expire = i->expire;
+    added = i->added;
     if (!mask || fprintf(f, "- %s:%s%lu:%s:%lu:%s\n", mask,
-        (i->flags & IGREC_PERM) ? "+" : "", i->expire,
-        i->user ? i->user : botnetnick, i->added,
+        (i->flags & IGREC_PERM) ? "+" : "", expire,
+        i->user ? i->user : botnetnick, added,
         i->msg ? i->msg : "") == EOF) {
       if (mask)
         nfree(mask);
Index: eggdrop1.7/src/userrec.c
diff -u eggdrop1.7/src/userrec.c:1.16 eggdrop1.7/src/userrec.c:1.17
--- eggdrop1.7/src/userrec.c:1.16	Mon Nov 20 07:53:36 2006
+++ eggdrop1.7/src/userrec.c	Sat Nov 25 07:14:32 2006
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: userrec.c,v 1.16 2006-11-20 13:53:36 tothwolf Exp $
+ * $Id: userrec.c,v 1.17 2006-11-25 13:14:32 tothwolf Exp $
  */
 
 #include "main.h"
@@ -523,6 +523,7 @@
   struct userrec *u, *x;
   struct xtra_key *xk;
   int oldshare = noshare;
+  long tv;
 
   noshare = 1;
   u = nmalloc(sizeof *u);
@@ -546,9 +547,10 @@
     xk->key = nmalloc(8);
     strcpy(xk->key, "created");
     now2 = nmalloc(15);
-    sprintf(now2, "%li", now);
+    tv = now;
+    sprintf(now2, "%li", tv);
     xk->data = nmalloc(strlen(now2) + 1);
-    sprintf(xk->data, "%li", now);
+    sprintf(xk->data, "%li", tv);
     set_user(&USERENTRY_XTRA, u, xk);
     nfree(now2);
   }
----------------------- End of diff -----------------------



More information about the Changes mailing list