[cvslog] (2006-11-20 11:38:39 UTC) Module eggdrop1.6: Change committed!

cvslog cvs at tsss.org
Mon Nov 20 05:38:41 CST 2006


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2006-11-20 11:38:38 UTC
Commited by: Tothwolf <tothwolf at techmonkeys.org>

Modified files:
     aclocal.m4 config.h.in doc/UPDATES1.6 src/Makefile.in src/dcc.c
     src/patch.h src/tcldcc.c src/tcluser.c src/userent.c
     src/userrec.c src/mod/channels.mod/tclchan.c
     src/mod/channels.mod/userchan.c src/mod/filesys.mod/filesys.c
     src/mod/seen.mod/seen.c

Log message:

* Fixed compatibility problems with certain time_t implementations.

---------------------- diff included ----------------------
Index: eggdrop1.6/aclocal.m4
diff -u eggdrop1.6/aclocal.m4:1.100 eggdrop1.6/aclocal.m4:1.101
--- eggdrop1.6/aclocal.m4:1.100	Mon Mar 27 00:48:57 2006
+++ eggdrop1.6/aclocal.m4	Mon Nov 20 05:38:25 2006
@@ -16,7 +16,7 @@
 dnl along with this program; if not, write to the Free Software
 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 dnl
-dnl $Id: aclocal.m4,v 1.100 2006-03-27 06:48:57 wcc Exp $
+dnl $Id: aclocal.m4,v 1.101 2006-11-20 11:38:25 tothwolf Exp $
 dnl
 
 
@@ -232,7 +232,7 @@
   ])
 
   if test "$egg_cv_socklen_t" = "yes"; then
-    AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define if your system has the `socklen_t' type.])
+    AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define to 1 if you have the `socklen_t' type.])
   fi
 ])
 
Index: eggdrop1.6/config.h.in
diff -u eggdrop1.6/config.h.in:1.46 eggdrop1.6/config.h.in:1.47
--- eggdrop1.6/config.h.in:1.46	Sun Jul  9 17:00:18 2006
+++ eggdrop1.6/config.h.in	Mon Nov 20 05:38:25 2006
@@ -163,7 +163,7 @@
 /* Define to 1 if you have the `snprintf' function. */
 #undef HAVE_SNPRINTF
 
-/* Define if your system has the `socklen_t' type. */
+/* Define to 1 if you have the `socklen_t' type. */
 #undef HAVE_SOCKLEN_T
 
 /* Define to 1 if you have the `srandom' function. */
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.631 eggdrop1.6/doc/UPDATES1.6:1.632
--- eggdrop1.6/doc/UPDATES1.6:1.631	Mon Aug 21 12:40:08 2006
+++ eggdrop1.6/doc/UPDATES1.6	Mon Nov 20 05:38:25 2006
@@ -1,4 +1,4 @@
-$Id: UPDATES1.6,v 1.631 2006-08-21 17:40:08 wcc Exp $
+$Id: UPDATES1.6,v 1.632 2006-11-20 11:38:25 tothwolf Exp $
 
 Eggdrop Changes (since v1.6.0)
     _____________________________________________________________________
@@ -12,6 +12,9 @@
 
 
   1.6.19:
+    - Fixed compatibility problems with certain time_t implementations.
+    * Found by: various - Patch by: Tothwolf
+
     - Complete raw traffic wasn't getting logged in some cases; only the raw
       command itself was. Fixed.
     * Patch by: mrBuG
Index: eggdrop1.6/src/Makefile.in
diff -u eggdrop1.6/src/Makefile.in:1.22 eggdrop1.6/src/Makefile.in:1.23
--- eggdrop1.6/src/Makefile.in:1.22	Mon Mar 27 20:35:49 2006
+++ eggdrop1.6/src/Makefile.in	Mon Nov 20 05:38:25 2006
@@ -1,5 +1,5 @@
 # Makefile for src/
-# $Id: Makefile.in,v 1.22 2006-03-28 02:35:49 wcc Exp $
+# $Id: Makefile.in,v 1.23 2006-11-20 11:38:25 tothwolf Exp $
 
 SHELL = @SHELL@
 top_srcdir = @top_srcdir@
@@ -52,6 +52,7 @@
 	@rm -f .depend *.o *.a *~
 
 build_msg:
+	@echo ""
 	@echo "This may take a while. Go get some runts."
 	@echo ""
 
Index: eggdrop1.6/src/dcc.c
diff -u eggdrop1.6/src/dcc.c:1.85 eggdrop1.6/src/dcc.c:1.86
--- eggdrop1.6/src/dcc.c:1.85	Mon Mar 27 20:35:50 2006
+++ eggdrop1.6/src/dcc.c	Mon Nov 20 05:38:25 2006
@@ -4,7 +4,7 @@
  *   disconnect on a dcc socket
  *   ...and that's it!  (but it's a LOT)
  *
- * $Id: dcc.c,v 1.85 2006-03-28 02:35:50 wcc Exp $
+ * $Id: dcc.c,v 1.86 2006-11-20 11:38:25 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -363,7 +363,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)
@@ -633,7 +636,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.6/src/mod/channels.mod/tclchan.c
diff -u eggdrop1.6/src/mod/channels.mod/tclchan.c:1.94 eggdrop1.6/src/mod/channels.mod/tclchan.c:1.95
--- eggdrop1.6/src/mod/channels.mod/tclchan.c:1.94	Mon Mar 27 20:35:50 2006
+++ eggdrop1.6/src/mod/channels.mod/tclchan.c	Mon Nov 20 05:38:25 2006
@@ -1,7 +1,7 @@
 /*
  * tclchan.c -- part of channels.mod
  *
- * $Id: tclchan.c,v 1.94 2006-03-28 02:35:50 wcc Exp $
+ * $Id: tclchan.c,v 1.95 2006-11-20 11:38:25 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1489,17 +1489,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.6/src/mod/channels.mod/userchan.c
diff -u eggdrop1.6/src/mod/channels.mod/userchan.c:1.47 eggdrop1.6/src/mod/channels.mod/userchan.c:1.48
--- eggdrop1.6/src/mod/channels.mod/userchan.c:1.47	Mon Mar 27 20:35:50 2006
+++ eggdrop1.6/src/mod/channels.mod/userchan.c	Mon Nov 20 05:38:25 2006
@@ -1,7 +1,7 @@
 /*
  * userchan.c -- part of channels.mod
  *
- * $Id: userchan.c,v 1.47 2006-03-28 02:35:50 wcc Exp $
+ * $Id: userchan.c,v 1.48 2006-11-20 11:38:25 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1064,16 +1064,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)
@@ -1095,10 +1098,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)
@@ -1119,16 +1124,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)
@@ -1150,10 +1158,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)
@@ -1174,16 +1184,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)
@@ -1205,10 +1218,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.6/src/mod/filesys.mod/filesys.c
diff -u eggdrop1.6/src/mod/filesys.mod/filesys.c:1.71 eggdrop1.6/src/mod/filesys.mod/filesys.c:1.72
--- eggdrop1.6/src/mod/filesys.mod/filesys.c:1.71	Sun May 28 20:56:08 2006
+++ eggdrop1.6/src/mod/filesys.mod/filesys.c	Mon Nov 20 05:38:26 2006
@@ -2,7 +2,7 @@
  * filesys.c -- part of filesys.mod
  *   main file of the filesys eggdrop module
  *
- * $Id: filesys.c,v 1.71 2006-05-29 01:56:08 wcc Exp $
+ * $Id: filesys.c,v 1.72 2006-11-20 11:38:26 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -550,7 +550,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.6/src/mod/seen.mod/seen.c
diff -u eggdrop1.6/src/mod/seen.mod/seen.c:1.37 eggdrop1.6/src/mod/seen.mod/seen.c:1.38
--- eggdrop1.6/src/mod/seen.mod/seen.c:1.37	Mon Mar 27 20:35:51 2006
+++ eggdrop1.6/src/mod/seen.mod/seen.c	Mon Nov 20 05:38:27 2006
@@ -10,7 +10,7 @@
  * 1.2     1997-08-20      Minor fixes. [BB]
  * 1.2a    1997-08-24      Minor fixes. [BB]
  *
- * $Id: seen.c,v 1.37 2006-03-28 02:35:51 wcc Exp $
+ * $Id: seen.c,v 1.38 2006-11-20 11:38:27 tothwolf Exp $
  */
 /*
  * Copyright (C) 1999 - 2006 Eggheads Development Team
@@ -163,6 +163,7 @@
   struct chanuserrec *cr;
   memberlist *m = NULL;
   int onchan = 0, i;
+  long tv;
   time_t laston = 0, work;
 
   whotarget[0]   = 0;
@@ -472,18 +473,19 @@
   word2[0] = 0;
   work = now - laston;
   if (work >= 86400) {
-    sprintf(word2, "%lu day%s, ", work / 86400,
-            ((work / 86400) == 1) ? "" : "s");
+    tv = work / 86400;
+    sprintf(word2, "%lu day%s, ", tv, (tv == 1) ? "" : "s");
     work = work % 86400;
   }
   if (work >= 3600) {
-    sprintf(word2 + strlen(word2), "%lu hour%s, ", work / 3600,
-            ((work / 3600) == 1) ? "" : "s");
+    tv = work / 3600;
+    sprintf(word2 + strlen(word2), "%lu hour%s, ", tv, (tv == 1) ? "" : "s");
     work = work % 3600;
   }
   if (work >= 60) {
-    sprintf(word2 + strlen(word2), "%lu minute%s, ", work / 60,
-            ((work / 60) == 1) ? "" : "s");
+    tv = work / 60;
+    sprintf(word2 + strlen(word2), "%lu minute%s, ", tv,
+            (tv == 1) ? "" : "s");
   }
   if (!word2[0] && (work < 60)) {
     strcpy(word2, "just moments ago!!");
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.1183 eggdrop1.6/src/patch.h:1.1184
--- eggdrop1.6/src/patch.h:1.1183	Mon Aug 21 12:40:08 2006
+++ eggdrop1.6/src/patch.h	Mon Nov 20 05:38:25 2006
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.1183 2006-08-21 17:40:08 wcc Exp $
+ * $Id: patch.h,v 1.1184 2006-11-20 11:38:25 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1156182021");            /* current unixtime */
+patch("1164022315");            /* current unixtime */
 /*
  *
  *
  */
-patch("raw-log");
+patch("long-time_t");
 /*
  *
  *
Index: eggdrop1.6/src/tcldcc.c
diff -u eggdrop1.6/src/tcldcc.c:1.57 eggdrop1.6/src/tcldcc.c:1.58
--- eggdrop1.6/src/tcldcc.c:1.57	Mon Mar 27 20:35:50 2006
+++ eggdrop1.6/src/tcldcc.c	Mon Nov 20 05:38:25 2006
@@ -2,7 +2,7 @@
  * tcldcc.c -- handles:
  *   Tcl stubs for the dcc commands
  *
- * $Id: tcldcc.c,v 1.57 2006-03-28 02:35:50 wcc Exp $
+ * $Id: tcldcc.c,v 1.58 2006-11-20 11:38:25 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -613,6 +613,7 @@
 {
   int i;
   char *p, idxstr[10], timestamp[11], other[160];
+  long tv;
   EGG_CONST char *list[6];
 
   BADARGS(1, 2, " ?type?");
@@ -621,7 +622,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 {
@@ -647,6 +649,7 @@
 {
   int chan, i;
   char c[2], idle[11], work[20], *p;
+  long tv = 0;
   EGG_CONST char *list[7];
 
   BADARGS(2, 2, " chan");
@@ -675,7 +678,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;
@@ -698,7 +702,8 @@
       if (party[i].timer == 0L)
         strcpy(idle, "0");
       else
-        egg_snprintf(idle, sizeof idle, "%li", (now - party[i].timer) / 60);
+        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.6/src/tcluser.c
diff -u eggdrop1.6/src/tcluser.c:1.41 eggdrop1.6/src/tcluser.c:1.42
--- eggdrop1.6/src/tcluser.c:1.41	Mon Mar 27 20:35:50 2006
+++ eggdrop1.6/src/tcluser.c	Mon Nov 20 05:38:25 2006
@@ -2,7 +2,7 @@
  * tcluser.c -- handles:
  *   Tcl stubs for the user-record-oriented commands
  *
- * $Id: tcluser.c,v 1.41 2006-03-28 02:35:50 wcc Exp $
+ * $Id: tcluser.c,v 1.42 2006-11-20 11:38:25 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -473,6 +473,7 @@
 static int tcl_ignorelist STDVAR
 {
   char expire[11], added[11], *p;
+  long tv;
   EGG_CONST char *list[5];
   struct igrec *i;
 
@@ -481,10 +482,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.6/src/userent.c
diff -u eggdrop1.6/src/userent.c:1.33 eggdrop1.6/src/userent.c:1.34
--- eggdrop1.6/src/userent.c:1.33	Mon Mar 27 20:35:50 2006
+++ eggdrop1.6/src/userent.c	Mon Nov 20 05:38:25 2006
@@ -2,7 +2,7 @@
  * userent.c -- handles:
  *   user-entry handling, new stylem more versatile.
  *
- * $Id: userent.c,v 1.33 2006-03-28 02:35:50 wcc Exp $
+ * $Id: userent.c,v 1.34 2006-11-20 11:38:25 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -308,11 +308,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);
@@ -325,9 +327,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;
@@ -363,6 +367,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?");
@@ -376,7 +381,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.6/src/userrec.c
diff -u eggdrop1.6/src/userrec.c:1.54 eggdrop1.6/src/userrec.c:1.55
--- eggdrop1.6/src/userrec.c:1.54	Mon Mar 27 20:35:50 2006
+++ eggdrop1.6/src/userrec.c	Mon Nov 20 05:38:25 2006
@@ -4,7 +4,7 @@
  *   a bunch of functions to find and change user records
  *   change and check user (and channel-specific) flags
  *
- * $Id: userrec.c,v 1.54 2006-03-28 02:35:50 wcc Exp $
+ * $Id: userrec.c,v 1.55 2006-11-20 11:38:25 tothwolf Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -385,6 +385,7 @@
 int write_user(struct userrec *u, FILE *f, int idx)
 {
   char s[181];
+  long tv;
   struct chanuserrec *ch;
   struct chanset_t *cst;
   struct user_entry *ue;
@@ -409,7 +410,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;
       }
@@ -432,16 +434,19 @@
 {
   struct igrec *i;
   char *mask;
+  long expire, added;
 
   if (global_ign)
     if (fprintf(f, IGNORE_NAME " - -\n") == EOF)        /* Daemus */
       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);
@@ -612,6 +617,7 @@
   struct userrec *u, *x;
   struct xtra_key *xk;
   int oldshare = noshare;
+  long tv;
 
   noshare = 1;
   u = nmalloc(sizeof *u);
@@ -635,9 +641,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