[cvslog] (2003-05-03 04:36:48 UTC) Module eggdrop1.6: Change committed

cvslog cvs at tsss.org
Fri May 2 22:36:48 CST 2003


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2003-05-03 04:36:48 UTC
Commited by: Will Buckner <wcc at techmonkeys.org>

Modified files:
     src/misc.c src/patch.h

Log message:

* Fixed bug 302. Patch by TaKeDa. Found by eviler.

---------------------- diff included ----------------------
Index: eggdrop1.6/src/misc.c
diff -u eggdrop1.6/src/misc.c:1.63 eggdrop1.6/src/misc.c:1.64
--- eggdrop1.6/src/misc.c:1.63	Tue Apr 29 22:47:46 2003
+++ eggdrop1.6/src/misc.c	Fri May  2 23:36:38 2003
@@ -7,7 +7,7 @@
  *   help system
  *   motd display and %var substitution
  *
- * $Id: misc.c,v 1.63 2003/04/30 03:47:46 wcc Exp $
+ * $Id: misc.c,v 1.64 2003/05/03 04:36:38 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -483,8 +483,8 @@
  */
 void putlog EGG_VARARGS_DEF(int, arg1)
 {
-  int i, type, tsl;
-  char *format, *chname, s[LOGLINELEN], s1[256], *out, ct[81], *s2, stamp[33];
+  int i, type, tsl = 0;
+  char *format, *chname, s[LOGLINELEN], s1[256], *out, ct[81], *s2, stamp[34];
   va_list va;
   time_t now2 = time(NULL);
   struct tm *t;
@@ -494,13 +494,15 @@
   format = va_arg(va, char *);
 
   /* Create the timestamp */
-  t = localtime(&now2);
-  egg_strftime(&stamp[0], 32, LOG_TS, t);
-  sprintf(&stamp[0], "%s ", stamp);
-  tsl = strlen(stamp);
+  if (shtime) {
+    t = localtime(&now2);
+    egg_strftime(stamp, sizeof(stamp) - 2, LOG_TS, t);
+    strcat(stamp, " ");
+    tsl = strlen(stamp);
+  }
 
   /* Format log entry at offset 'tsl,' then i can prepend the timestamp */
-  out = &s[tsl];
+  out = s+tsl;
   /* No need to check if out should be null-terminated here,
    * just do it! <cybah>
    */
@@ -523,7 +525,7 @@
   }
   /* Place the timestamp in the string to be printed */
   if ((out[0]) && (shtime)) {
-    strncpy(&s[0], stamp, tsl);
+    strncpy(s, stamp, tsl);
     out = s;
   }
   strcat(out, "\n");
@@ -668,7 +670,7 @@
          */
         char stamp[33];
 
-        egg_strftime(&stamp[0], 32, LOG_TS, localtime(&now));
+        egg_strftime(stamp, sizeof(stamp) - 1, LOG_TS, localtime(&now));
         fprintf(logs[i].f, "%s ", stamp);
         fprintf(logs[i].f, MISC_LOGREPEAT, logs[i].repeats);
         /* Reset repeats */
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.986 eggdrop1.6/src/patch.h:1.987
--- eggdrop1.6/src/patch.h:1.986	Tue Apr 29 22:47:46 2003
+++ eggdrop1.6/src/patch.h	Fri May  2 23:36:38 2003
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  *
- * $Id: patch.h,v 1.986 2003/04/30 03:47:46 wcc Exp $
+ * $Id: patch.h,v 1.987 2003/05/03 04:36:38 wcc Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("1051674454");            /* current unixtime */
+patch("1051936491");            /* current unixtime */
 /*
  *
  *
  */
-patch("ipv6-5");
+patch("log_time2");
 /*
  *
  *
----------------------- End of diff -----------------------


More information about the Changes mailing list