[cvslog] Module eggdrop1.6: Change committed

cvslog cvs at tsss.iavalley.cc.ia.us
Sun Dec 10 09:11:01 CST 2000


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2000-12-10 15:10:37 UTC

Modified files:
     doc/UPDATES1.6 src/chanprog.c src/cmds.c src/dcc.c src/dccutil.c
     src/dns.c src/flags.c src/language.c src/main.c src/mem.c
     src/misc.c src/misc_file.c src/modules.c src/net.c src/patch.h
     src/rfc1459.c src/tcl.c src/tcldcc.c src/tclhash.c src/tclmisc.c
     src/userent.c src/userrec.c src/users.c

Log message:

guppy: core_cleanup.diff ...

---------------------- diff included ----------------------
Index: eggdrop1.6/doc/UPDATES1.6
diff -u eggdrop1.6/doc/UPDATES1.6:1.32 eggdrop1.6/doc/UPDATES1.6:1.33
--- eggdrop1.6/doc/UPDATES1.6:1.32	Thu Dec  7 21:07:38 2000
+++ eggdrop1.6/doc/UPDATES1.6	Sun Dec 10 09:10:26 2000
@@ -4,6 +4,9 @@
 
 1.6.2
 Found by  Fixed by  What...
+          guppy     cleaned up Context; usage in the core
+          guppy     rewrote tcl_duration
+          guppy     more use of strncpyz and egg_snprintf in the core
           guppy     did some cleanup in tcl[user/misc/dcc].c
           Sup       Added a channel option to .[un]stick and slightly
                     cleaned up channels.mod/cmdschan.c.
Index: eggdrop1.6/src/chanprog.c
diff -u eggdrop1.6/src/chanprog.c:1.19 eggdrop1.6/src/chanprog.c:1.20
--- eggdrop1.6/src/chanprog.c:1.19	Wed Nov 15 20:49:14 2000
+++ eggdrop1.6/src/chanprog.c	Sun Dec 10 09:10:26 2000
@@ -7,7 +7,7 @@
  *   telling the current programmed settings
  *   initializing a lot of stuff and loading the tcl scripts
  * 
- * $Id: chanprog.c,v 1.19 2000/11/16 02:49:14 guppy Exp $
+ * $Id: chanprog.c,v 1.20 2000/12/10 15:10:26 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -131,7 +131,7 @@
   register memberlist		*m;
   register struct chanset_t	*chan;
 
-  strncpy(buf, host, UHOSTMAX), buf[UHOSTMAX] = 0;
+  strncpyz(buf, host, sizeof buf);
   uhost = buf;
   nick = splitnick(&uhost);
   for (chan = chanset; chan; chan = chan->next)
@@ -196,7 +196,7 @@
   register memberlist		*m;
   register struct chanset_t	*chan;
 
-  strncpy(buf, host, UHOSTMAX), buf[UHOSTMAX] = 0;
+  strncpyz(buf, host, sizeof buf);
   uhost = buf;
   nick = splitnick(&uhost);
   for (chan = chanset; chan; chan = chan->next)
@@ -212,7 +212,6 @@
   register int		 tot = 0;
   register tcl_timer_t	*t;
 
-  Context;
   for (t = timer; t; t = t->next)
     tot += sizeof(tcl_timer_t) + strlen(t->cmd) + 1;
   for (t = utimer; t; t = t->next)
@@ -334,8 +333,7 @@
   dprintf(idx, "%s %s  (%s)  %s  %s %4.1f%%\n", MISC_ONLINEFOR,
 	  s, s1, s2, MISC_CACHEHIT,
 	  100.0 * ((float) cache_hit) / ((float) (cache_hit + cache_miss)));
-  strcpy(s, "info library");
-  if ((interp) && (Tcl_Eval(interp, s) == TCL_OK))
+  if ((interp) && (Tcl_Eval(interp, "info library") == TCL_OK))
     dprintf(idx, "%s %s\n", MISC_TCLLIBVER, interp->result);
 }
 
@@ -383,8 +381,7 @@
     q = owner;
     p = strchr(q, ',');
     while (p) {
-      strncpy(s, q, p - q);
-      s[p - q] = 0;
+      strncpyz(s, q, p - q);
       rmspace(s);
       u = get_user_by_handle(userlist, s);
       if (u)
@@ -413,7 +410,6 @@
   /* Turn off read-only variables (make them write-able) for rehash */
   protect_readonly = 0;
   /* Now read it */
-  Context;
   if (!readtclprog(configfile))
     fatal(MISC_NOCONFIGFILE, 0);
   for (i = 0; i < max_logs; i++) {
@@ -436,7 +432,6 @@
   }
   /* We should be safe now */
   call_hook(HOOK_REHASH);
-  Context;
   protect_readonly = 1;
   if (!userfile[0])
     fatal(MISC_NOUSERFILE2, 0);
@@ -460,7 +455,6 @@
      make_userfile = 0;
      printf("%s\n", MISC_USERFEXISTS);
   }
-  Context;
   if (helpdir[0])
     if (helpdir[strlen(helpdir) - 1] != '/')
       strcat(helpdir, "/");
@@ -468,12 +462,10 @@
     if (tempdir[strlen(tempdir) - 1] != '/')
       strcat(tempdir, "/");
   if (!botnetnick[0]) {
-    strncpy(botnetnick, origbotname, HANDLEN);
-    botnetnick[HANDLEN] = 0;
+    strncpyz(botnetnick, origbotname, HANDLEN + 1);
   }
   if (!botnetnick[0])
     fatal("I don't have a botnet nick!!\n", 0);
-  Context;
   /* Test tempdir: it's vital */
   {
     FILE *f;
@@ -493,7 +485,6 @@
     fclose(f);
     unlink(s);
   }
-  Context;
   reaffirm_owners();
 }
 
@@ -515,7 +506,6 @@
   userlist = NULL;
   if (!readuserfile(userfile, &userlist))
     fatal(MISC_MISSINGUSERF, 0);
-  Context;
   reaffirm_owners();
   call_hook(HOOK_READ_USERFILE);
 }
@@ -581,7 +571,7 @@
 void do_check_timers(tcl_timer_t **stack)
 {
   tcl_timer_t *mark = *stack, *old = NULL;
-  char x[30];
+  char x[16];
 
   /* New timers could be added by a Tcl script inside a current timer
    * so i'll just clear out the timer list completely, and add any
@@ -593,8 +583,8 @@
       mark->mins--;
     old = mark;
     mark = mark->next;
-    if (old->mins == 0) {
-      simple_sprintf(x, "timer%d", old->id);
+    if (!old->mins) {
+      egg_snprintf(x, sizeof x, "timer%lu", old->id);
       do_tcl(x, old->cmd);
       nfree(old->cmd);
       nfree(old);
@@ -625,11 +615,11 @@
 void list_timers(Tcl_Interp *irp, tcl_timer_t *stack)
 {
   tcl_timer_t *mark = stack;
-  char mins[10], id[20], *argv[3], *x;
+  char mins[10], id[16], *argv[3], *x;
 
   while (mark != NULL) {
-    sprintf(mins, "%u", mark->mins);
-    sprintf(id, "timer%lu", mark->id);
+    egg_snprintf(mins, sizeof mins, "%u", mark->mins);
+    egg_snprintf(id, sizeof id, "timer%lu", mark->id);
     argv[0] = mins;
     argv[1] = mark->cmd;
     argv[2] = id;
Index: eggdrop1.6/src/cmds.c
diff -u eggdrop1.6/src/cmds.c:1.44 eggdrop1.6/src/cmds.c:1.45
--- eggdrop1.6/src/cmds.c:1.44	Mon Nov 20 23:18:04 2000
+++ eggdrop1.6/src/cmds.c	Sun Dec 10 09:10:26 2000
@@ -3,7 +3,7 @@
  *   commands from a user via dcc
  *   (split in 2, this portion contains no-irc commands)
  * 
- * $Id: cmds.c,v 1.44 2000/11/21 05:18:04 guppy Exp $
+ * $Id: cmds.c,v 1.45 2000/12/10 15:10:26 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -93,7 +93,7 @@
   int i, k, ok = 0, atr = u ? u->flags : 0, len;
   char s[1024];			/* temp fix - 1.4 has a better one */
 
-  if (chan == 0)
+  if (!chan)
     dprintf(idx, "Party line members:  (* = owner, + = master, @ = op)\n");
   else {
     simple_sprintf(s, "assoc %d", chan);
@@ -185,7 +185,7 @@
       if (atr & USER_MASTER) {
 	if (dcc[i].u.chat->channel < 0)
 	  strcat(s, "(-OFF-) ");
-	else if (dcc[i].u.chat->channel == 0)
+	else if (!dcc[i].u.chat->channel)
 	  strcat(s, "(party) ");
 	else
 	  sprintf(&s[strlen(s)], "(%5d) ", dcc[i].u.chat->channel);
@@ -236,7 +236,6 @@
   time_t now2;
   int hr, min;
 
-  Context;
   chan = chanset;
   now2 = now - online_since;
   s2[0] = 0;
@@ -685,8 +684,7 @@
 	      nick);
       return;
     }
-    strncpy(dcc[dest].u.chat->con_chan, nick, 81);
-    dcc[dest].u.chat->con_chan[80] = 0;
+    strncpyz(dcc[dest].u.chat->con_chan, nick, 81);
     nick[0] = 0;
     if ((dest == idx) && !glob_master(fr) && !chan_master(fr))
       /* Consoling to another channel for self */
@@ -815,10 +813,8 @@
   int i, atr = u ? u->flags : 0, atr2;
   struct userrec *u2;
 
-  strncpy(hand, newsplit(&par), sizeof(hand));
-  hand[HANDLEN] = 0;
-  strncpy(newhand, newsplit(&par), sizeof(newhand));
-  newhand[HANDLEN] = 0;
+  strncpyz(hand, newsplit(&par), sizeof hand);
+  strncpyz(newhand, newsplit(&par), sizeof newhand);
 
   if (!hand[0] || !newhand[0]) {
     dprintf(idx, "Usage: chhandle <oldhandle> <newhandle>\n");
@@ -863,8 +859,7 @@
   char oldhandle[HANDLEN + 1], newhandle[HANDLEN + 1];
   int i;
 
-  strncpy(newhandle, newsplit(&par), HANDLEN);
-  newhandle[HANDLEN] = 0;
+  strncpyz(newhandle, newsplit(&par), sizeof newhandle);
 
   if (!newhandle[0]) {
     dprintf(idx, "Usage: handle <new-handle>\n");
@@ -882,8 +877,7 @@
   } else if (!egg_strcasecmp(newhandle, botnetnick)) {
     dprintf(idx, "Hey!  That's MY name!\n");
   } else {
-    strncpy(oldhandle, dcc[idx].nick, HANDLEN);
-    oldhandle[HANDLEN] = 0;
+    strncpyz(oldhandle, dcc[idx].nick, sizeof oldhandle);
     if (change_handle(u, newhandle)) {
       putlog(LOG_CMDS, "*", "#%s# handle %s", oldhandle, newhandle);
       dprintf(idx, "Okay, changed.\n");
@@ -970,8 +964,7 @@
     bi->relay_port = 3333;
   } else {
     bi->address = user_malloc(q - addr + 1);
-    strncpy(bi->address, addr, q - addr);
-    bi->address[q - addr] = 0;
+    strncpyz(bi->address, addr, q - addr);
     p = q + 1;
     bi->telnet_port = atoi(p);
     q = strchr(p, '/');
@@ -1255,8 +1248,7 @@
     q = owner;
     p = strchr(q, ',');
     while (p) {
-      strncpy(s, q, p - q);
-      s[p - q] = 0;
+      strncpyz(s, q, p - q);
       rmspace(s);
       if (!egg_strcasecmp(u->handle, s))
 	u->flags = sanity_check(u->flags | USER_OWNER);
@@ -1350,7 +1342,6 @@
 	  if (dcc[i].u.chat->channel >= 0) {
 	    chanout_but(-1, dcc[i].u.chat->channel,
 			"*** %s has returned.\n", dcc[i].nick);
-	    Context;
 	    if (dcc[i].u.chat->channel < 100000)
 	      botnet_send_join_idx(i, -1);
 	  }
@@ -1499,7 +1490,6 @@
 	return;
       }
     } else if (arg && !strpbrk(chg, "&|")) {
-      Context;
       tmpchg = nmalloc(strlen(chg) + 2);
       strcpy(tmpchg, "|");
       strcat(tmpchg, chg);
@@ -1690,7 +1680,6 @@
 	return;
       }
     } else if (arg && !strpbrk(chg, "&|")) {
-      Context;
       tmpchg = nmalloc(strlen(chg) + 2);
       strcpy (tmpchg, "|");
       strcat (tmpchg, chg);
@@ -1785,7 +1774,6 @@
       chanout_but(-1, dcc[idx].u.chat->channel,
 		  "*** %s left the party line.\n",
 		  dcc[idx].nick);
-      Context;
       if (dcc[idx].u.chat->channel < 100000)
 	botnet_send_part_idx(idx, "");
     }
@@ -1793,7 +1781,7 @@
   } else {
     if (arg[0] == '*') {
       if (((arg[1] < '0') || (arg[1] > '9'))) {
-	if (arg[1] == 0)
+	if (!arg[1])
 	  newchan = 0;
 	else {
 	  Tcl_SetVar(interp, "chan", arg, 0);
@@ -1842,7 +1830,7 @@
     if ((dcc[idx].u.chat->channel < 0) && (dcc[idx].u.chat->away != NULL))
       not_away(idx);
     if (dcc[idx].u.chat->channel == newchan) {
-      if (newchan == 0) {
+      if (!newchan) {
 	dprintf(idx, "You're already on the party line!\n");
         return;
       } else {
@@ -1854,22 +1842,18 @@
       oldchan = dcc[idx].u.chat->channel;
       if (oldchan >= 0)
 	check_tcl_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock, oldchan);
-      if (oldchan == 0) {
+      if (!oldchan) {
 	chanout_but(-1, 0, "*** %s left the party line.\n", dcc[idx].nick);
-	Context;
       } else if (oldchan > 0) {
 	chanout_but(-1, oldchan, "*** %s left the channel.\n", dcc[idx].nick);
-	Context;
       }
       dcc[idx].u.chat->channel = newchan;
-      if (newchan == 0) {
+      if (!newchan) {
 	dprintf(idx, "Entering the party line...\n");
 	chanout_but(-1, 0, "*** %s joined the party line.\n", dcc[idx].nick);
-	Context;
       } else {
 	dprintf(idx, "Joining channel '%s'...\n", arg);
 	chanout_but(-1, newchan, "*** %s joined the channel.\n", dcc[idx].nick);
-	Context;
       }
       check_tcl_chjn(botnetnick, dcc[idx].nick, newchan, geticon(idx),
 		     dcc[idx].sock, dcc[idx].host);
@@ -2080,7 +2064,6 @@
   int atr = u ? u->flags : 0;
   struct flag_record fr = {FR_ANYWH | FR_CHAN | FR_GLOBAL, 0, 0, 0, 0, 0};
 
-  Context;
   u = get_user_by_handle(userlist, par);
 
   if (!par[0])
@@ -2111,7 +2094,6 @@
 	  botnet_send_part_idx(idx, "");
 	chanout_but(-1, dcc[idx].u.chat->channel,
 		    "*** %s left the party line.\n", dcc[idx].nick);
-	Context;
 	/* Store the old nick in the away section, for weenies who can't get
 	 * their password right ;)
 	 */
@@ -2178,7 +2160,7 @@
     return;
   }
   a = atoi(par);
-  if ((a == 0 && par[0] == 0) || !egg_strcasecmp(par, "off")) {
+  if ((!a && !par[0]) || !egg_strcasecmp(par, "off")) {
     dcc[idx].status &= ~STAT_PAGE;
     dcc[idx].u.chat->max_line = 0x7ffffff;	/* flush_lines needs this */
     while (dcc[idx].u.chat->buffer)
@@ -2253,7 +2235,6 @@
 
 static void cmd_module(struct userrec *u, int idx, char *par)
 {
-  Context;
   putlog(LOG_CMDS, "*", "#%s# module %s", dcc[idx].nick, par);
   do_module_report(idx, 2, par[0] ? par : NULL);
 }
@@ -2266,7 +2247,6 @@
          dprintf(idx, MISC_NOSUCHCMD);
          return;
      }
-  Context;
   if (!par[0]) {
     dprintf(idx, "%s: loadmod <module>\n", MISC_USAGE);
   } else {
@@ -2279,7 +2259,6 @@
       dprintf(idx, "\n");
     }
   }
-  Context;
 }
 
 static void cmd_unloadmod(struct userrec *u, int idx, char *par)
@@ -2290,7 +2269,6 @@
          dprintf(idx, MISC_NOSUCHCMD);
          return;
      }
-  Context;
   if (!par[0]) {
     dprintf(idx, "%s: unloadmod <module>\n", MISC_USAGE);
   } else {
@@ -2386,8 +2364,7 @@
     dprintf(idx, "Usage: -ignore <hostmask | ignore #>\n");
     return;
   }
-  strncpy(buf, par, UHOSTMAX);
-  buf[UHOSTMAX] = 0;
+  strncpyz(buf, par, sizeof buf);
   if (delignore(buf)) {
     putlog(LOG_CMDS, "*", "#%s# -ignore %s", dcc[idx].nick, buf);
     dprintf(idx, "No longer ignoring: %s\n", buf);
@@ -2483,7 +2460,6 @@
   struct list_type *q;
   struct flag_record fr = {FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0};
 
-  Context;
   if (!par[0]) {
     dprintf(idx, "Usage: +host [handle] <newhostmask>\n");
     return;
@@ -2525,7 +2501,6 @@
       return;
     }
   }
-  Context;
   if (!(u->flags & USER_BOTMAST) && !chan_master(fr)) {
     if (get_user_by_host(host)) {
       dprintf(idx, "You cannot add a host matching another user!\n");
@@ -2595,7 +2570,6 @@
 {
   int ptr;
 
-  Context;
   if (!par[0])
     dprintf(idx, "Usage: modules <bot>\n");
   else {
@@ -2612,7 +2586,6 @@
 {
   int itmp, itmp2;
 
-  Context;
   dprintf(idx, "Traffic since last restart\n");
   dprintf(idx, "==========================\n");
   if (otraffic_irc > 0 || itraffic_irc > 0 || otraffic_irc_today > 0 ||
@@ -2681,7 +2654,6 @@
   char unit[10];
   float xbytes;
 
-  Context;
   sprintf(unit, "Bytes");
   xbytes = bytes;
   if (xbytes > 1024.0) {
@@ -2704,7 +2676,6 @@
     sprintf(traffictxt, "%.2f %s", xbytes, unit);
   else
     sprintf(traffictxt, "%d Bytes", bytes);
-  Context;
   return traffictxt;
 }
 
Index: eggdrop1.6/src/dcc.c
diff -u eggdrop1.6/src/dcc.c:1.40 eggdrop1.6/src/dcc.c:1.41
--- eggdrop1.6/src/dcc.c:1.40	Mon Oct 30 14:50:41 2000
+++ eggdrop1.6/src/dcc.c	Sun Dec 10 09:10:27 2000
@@ -4,7 +4,7 @@
  *   disconnect on a dcc socket
  *   ...and that's it!  (but it's a LOT)
  * 
- * $Id: dcc.c,v 1.40 2000/10/30 20:50:41 fabian Exp $
+ * $Id: dcc.c,v 1.41 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -153,7 +153,6 @@
   char x[1024];
   int l;
 
-  Context;
   dcc[idx].timeval = now;
   if (in_chain(dcc[idx].nick)) {
     dprintf(idx, "error Sorry, already connected.\n");
@@ -197,8 +196,7 @@
 #ifndef NO_OLD_BOTNET
   }
 #endif
-  strncpy(dcc[idx].u.bot->version, par, 120);
-  dcc[idx].u.bot->version[120] = 0;
+  strncpyz(dcc[idx].u.bot->version, par, 120);
   putlog(LOG_BOTS, "*", DCC_LINKED, dcc[idx].nick);
   chatout("*** Linked to %s\n", dcc[idx].nick);
   botnet_send_nlinked(idx, dcc[idx].nick, botnetnick, '!',
@@ -208,7 +206,7 @@
   addbot(dcc[idx].nick, dcc[idx].nick, botnetnick, '-',
 	 dcc[idx].u.bot->numver);
   check_tcl_link(dcc[idx].nick, botnetnick);
-  simple_sprintf(x, "v %d", dcc[idx].u.bot->numver);
+  egg_snprintf(x, sizeof x, "v %d", dcc[idx].u.bot->numver);
   bot_share(idx, x);
   dprintf(idx, "el\n");
 }
@@ -219,7 +217,7 @@
 
   if (dcc[idx].port >= dcc[idx].u.bot->port + 3) {
     if (dcc[idx].u.bot->linker[0]) {
-      sprintf(s, "Couldn't link to %s.", dcc[idx].nick);
+      egg_snprintf(s, sizeof s, "Couldn't link to %s.", dcc[idx].nick);
       strcpy(s1, dcc[idx].u.bot->linker);
       add_note(s1, botnetnick, s, -2, 0);
     }
@@ -251,7 +249,6 @@
   int atr = bot_flags(dcc[idx].user);
   int users, bots;
 
-  Context;
   if (atr & BOT_HUB) {
     /* Disconnect all +a bots because we just got a hub */
     for (i = 0; i < dcc_total; i++) {
@@ -269,7 +266,7 @@
       if (i > 0) {
 	bots = bots_in_subtree(findbot(dcc[idx].nick));
 	users = users_in_subtree(findbot(dcc[idx].nick));
-	simple_sprintf(x,
+	egg_snprintf(x, sizeof x,
 		      "Unlinked %s (restructure) (lost %d bot%s and %d user%s)",
 		      dcc[i].nick, bots, (bots != 1) ? "s" : "",
 		      users, (users != 1) ? "s" : "");
@@ -352,7 +349,6 @@
 
 static void eof_dcc_bot_new(int idx)
 {
-  Context;
   putlog(LOG_BOTS, "*", DCC_LOSTBOT, dcc[idx].nick, dcc[idx].port);
   killsock(dcc[idx].sock);
   lostdcc(idx);
@@ -407,7 +403,6 @@
   char *msg;
   int f;
 
-  Context;
   strip_telnet(dcc[idx].sock, code, &i);
   if (debug_output) {
     if (code[0] == 's')
@@ -424,7 +419,7 @@
   for (f = i = 0; C_bot[i].name && !f; i++) {
     int y = egg_strcasecmp(code, C_bot[i].name);
 
-    if (y == 0) {
+    if (!y) {
       /* Found a match */
       (C_bot[i].func)(idx, msg);
       f = 1;
@@ -440,7 +435,8 @@
 
   bots = bots_in_subtree(findbot(dcc[idx].nick));
   users = users_in_subtree(findbot(dcc[idx].nick));
-  simple_sprintf(x, "Lost bot: %s (lost %d bot%s and %d user%s)",
+  egg_snprintf(x, sizeof x,
+	       "Lost bot: %s (lost %d bot%s and %d user%s)",
   		 dcc[idx].nick, bots, (bots != 1) ? "s" : "", users,
 		 (users != 1) ? "s" : "");
   putlog(LOG_BOTS, "*", "%s.", x);
@@ -853,26 +849,19 @@
 
 static void eof_dcc_chat(int idx)
 {
-  Context;
   putlog(LOG_MISC, "*", DCC_LOSTDCC, dcc[idx].nick,
 	 dcc[idx].host, dcc[idx].port);
-  Context;
   if (dcc[idx].u.chat->channel >= 0) {
     chanout_but(idx, dcc[idx].u.chat->channel, "*** %s lost dcc link.\n",
 		dcc[idx].nick);
-    Context;
     if (dcc[idx].u.chat->channel < 100000)
       botnet_send_part_idx(idx, "lost dcc link");
     check_tcl_chpt(botnetnick, dcc[idx].nick, dcc[idx].sock,
 		   dcc[idx].u.chat->channel);
   }
-  Context;
   check_tcl_chof(dcc[idx].nick, dcc[idx].sock);
-  Context;
   killsock(dcc[idx].sock);
-  Context;
   lostdcc(idx);
-  Context;
 }
 
 static void dcc_chat(int idx, char *buf, int i)
@@ -880,7 +869,6 @@
   int nathan = 0, doron = 0, fixed = 0;
   char *v, *d;
 
-  Context;
   strip_telnet(dcc[idx].sock, buf, &i);
   if (buf[0] && (buf[0] != '.') &&
       detect_dcc_flood(&dcc[idx].timeval, dcc[idx].u.chat, idx))
@@ -1068,10 +1056,8 @@
 {
   struct flag_record fr = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0};
 
-  Context;
   get_user_flagrec(get_user_by_host(floodhost), &fr, NULL);
-  Context;
-  if (flood_telnet_thr == 0 || (glob_friend(fr) && !par_telnet_flood))
+  if (!flood_telnet_thr || (glob_friend(fr) && !par_telnet_flood))
     return 0;			/* No flood protection */
   if (egg_strcasecmp(lasttelnethost, floodhost)) {	/* New... */
     strcpy(lasttelnethost, floodhost);
@@ -1106,7 +1092,6 @@
   int j = 0, sock;
   char s[UHOSTLEN + 1];
 
-  Context;
   if (dcc_total + 1 > max_dcc) {
     j = answer(dcc[idx].sock, s, &ip, &port, 0);
     if (j != -1) {
@@ -1115,7 +1100,6 @@
     }
     return;
   }
-  Context;
   sock = answer(dcc[idx].sock, s, &ip, &port, 0);
   while ((sock == -1) && (errno == EAGAIN))
     sock = answer(sock, s, &ip, &port, 0);
@@ -1130,14 +1114,12 @@
   /* <bindle> [09:37] Telnet connection: 168.246.255.191/0
    * <bindle> [09:37] Lost connection while identing [168.246.255.191/0]
    */
-  Context;
   /* Use dcc-portrange x:x on incoming telnets too, dw */
   if ((port < min_dcc_port) || (port > max_dcc_port)) {
     putlog(LOG_BOTS, "*", DCC_BADSRC, s, port);
     killsock(sock);
     return;
   }
-  Context;
   /* Deny ips that ends with 0 or 255, dw */
   if ((ip & 0xff) == 0 || (ip & 0xff) == 0xff) {
     putlog(LOG_BOTS, "*", DCC_BADIP, s, port);
@@ -1165,8 +1147,7 @@
   int j = 0, sock;
   char s[UHOSTLEN], s2[UHOSTLEN + 20];
 
-  strncpy(dcc[i].host, dcc[i].u.dns->host, UHOSTMAX);
-  dcc[i].host[UHOSTMAX] = 0;
+  strncpyz(dcc[i].host, dcc[i].u.dns->host, UHOSTLEN);
 
   for (idx = 0; idx < dcc_total; idx++)
     if ((dcc[idx].type == &DCC_TELNET) &&
@@ -1189,7 +1170,6 @@
       return;
     }
   }
-  Context;
   sprintf(s2, "-telnet!telnet@%s", dcc[i].host);
   if (match_ignore(s2) || detect_telnet_flood(s2)) {
     killsock(dcc[i].sock);
@@ -1197,14 +1177,12 @@
     return;
   }
 
-  Context;
   changeover_dcc(i, &DCC_IDENTWAIT, 0);
   dcc[i].timeval = now;
   dcc[i].u.ident_sock = dcc[idx].sock;
   sock = open_telnet(iptostr(htonl(dcc[i].addr)), 113);
   putlog(LOG_MISC, "*", DCC_TELCONN, dcc[i].host, dcc[i].port);
   s[0] = 0;
-  Context;
   if (sock < 0) {
     if (sock == -2)
       strcpy(s, "DNS lookup failed for ident");
@@ -1217,14 +1195,12 @@
       strcpy(s, "No Free DCC's");
     }
   }
-  Context;
   if (s[0]) {
     putlog(LOG_MISC, "*", DCC_IDENTFAIL, dcc[i].host, s);
     sprintf(s, "telnet@%s", dcc[i].host);
     dcc_telnet_got_ident(i, s);
     return;
   }
-  Context;
   dcc[j].sock = sock;
   dcc[j].port = 113;
   dcc[j].addr = dcc[i].addr;
@@ -1281,7 +1257,6 @@
  */
 static void timeout_dupwait(int idx)
 {
-  Context;
   /* Still duplicate? */
   if (in_chain(dcc[idx].nick)) {
     dprintf(idx, "error Already connected.\n");
@@ -1304,7 +1279,6 @@
   register struct dupwait_info *p = (struct dupwait_info *) x;
   int tot = sizeof(struct dupwait_info);
 
-  Context;
   if (p && p->chat && DCC_CHAT.expmem)
     tot += DCC_CHAT.expmem(p->chat);
   return tot;
@@ -1314,7 +1288,6 @@
 {
   register struct dupwait_info *p = (struct dupwait_info *) x;
 
-  Context;
   if (p) {
     if (p->chat && DCC_CHAT.kill)
       DCC_CHAT.kill(idx, p->chat);
@@ -1344,7 +1317,6 @@
 {
   register int idx;
 
-  Context;
   Assert(who);
   for (idx = 0; idx < dcc_total; idx++)
     if ((dcc[idx].type == &DCC_DUPWAIT) &&
@@ -1359,7 +1331,6 @@
   int ok = 0;
   struct flag_record fr = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0};
 
-  Context;
   strip_telnet(dcc[idx].sock, buf, &atr);
   buf[HANDLEN] = 0;
   /* Toss out bad nicknames */
@@ -1445,7 +1416,6 @@
   int ok = 0;
   struct flag_record fr = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0, 0, 0};
 
-  Context;
   get_user_flagrec(dcc[idx].user, &fr, NULL);
   /* No password set? */
   if (u_pass_match(dcc[idx].user, "-")) {
@@ -1768,7 +1738,7 @@
   long oldsock;
 
   strip_telnet(dcc[idx].sock, buf, &len);
-  if (len == 0)
+  if (!len)
     return;
 
   dcc[idx].timeval = now;
@@ -1776,7 +1746,6 @@
   if (call_tcl_func(dcc[idx].u.script->command, dcc[idx].sock, buf)) {
     void *old_other = NULL;
 
-    Context;
     /* Check whether the socket and dcc entry are still valid. They
        might have been killed by `killdcc'. */
     if (dcc[idx].sock != oldsock || idx > max_dcc)
@@ -1795,7 +1764,6 @@
     if (dcc[idx].type == &DCC_CHAT) {
       if (dcc[idx].u.chat->channel >= 0) {
 	chanout_but(-1, dcc[idx].u.chat->channel, DCC_JOIN, dcc[idx].nick);
-	Context;
 	if (dcc[idx].u.chat->channel < 10000)
 	  botnet_send_join_idx(idx, -1);
 	check_tcl_chjn(botnetnick, dcc[idx].nick, dcc[idx].u.chat->channel,
@@ -1811,7 +1779,6 @@
   void *old;
   int oldflags;
 
-  Context;
   /* This will stop a killdcc from working, incase the script tries
    * to kill it's controlling socket while handling an EOF <cybah>
    */
@@ -1821,7 +1788,6 @@
   call_tcl_func(dcc[idx].u.script->command, dcc[idx].sock, "");
   /* Restore the flags */
   dcc[idx].type->flags = oldflags;
-  Context;
   old = dcc[idx].u.script->u.other;
   dcc[idx].type = dcc[idx].u.script->type;
   nfree(dcc[idx].u.script);
@@ -1936,7 +1902,6 @@
 void dcc_identwait(int idx, char *buf, int len)
 {
   /* Ignore anything now */
-  Context;
 }
 
 void eof_dcc_identwait(int idx)
@@ -1981,7 +1946,6 @@
   char response[512], uid[512], buf1[UHOSTLEN];
   int i;
 
-  Context;
   sscanf(buf, "%*[^:]:%[^:]:%*[^:]:%[^\n]\n", response, uid);
   rmspace(response);
   if (response[0] != 'U') {
@@ -2053,14 +2017,12 @@
     lostdcc(i);
     return;
   }
-  strncpy(dcc[i].host, host, UHOSTMAX);
-  dcc[i].host[UHOSTMAX] = 0;
-  simple_sprintf(x, "-telnet!%s", dcc[i].host);
+  strncpyz(dcc[i].host, host, UHOSTLEN);
+  egg_snprintf(x, sizeof x, "-telnet!%s", dcc[i].host);
   if (protect_telnet && !make_userfile) {
     struct userrec *u;
     int ok = 1;
 
-    Context;
     u = get_user_by_host(x);
     /* Not a user or +p & require p OR +o */
     if (!u)
@@ -2080,7 +2042,6 @@
       return;
     }
   }
-  Context;
   if (match_ignore(x)) {
     killsock(dcc[i].sock);
     lostdcc(i);
@@ -2109,8 +2070,7 @@
   if (!strcmp(dcc[idx].nick, "(users)"))
     dcc[i].status |= STAT_USRONLY;
   /* Copy acceptable-nick/host mask */
-  strncpy(dcc[i].nick, dcc[idx].host, HANDLEN);
-  dcc[i].nick[HANDLEN] = 0;
+  strncpyz(dcc[i].nick, dcc[idx].host, HANDLEN);
   dcc[i].timeval = now;
   strcpy(dcc[i].u.chat->con_chan, chanset ? chanset->name : "*");
   /* Displays a customizable banner. */
Index: eggdrop1.6/src/dccutil.c
diff -u eggdrop1.6/src/dccutil.c:1.23 eggdrop1.6/src/dccutil.c:1.24
--- eggdrop1.6/src/dccutil.c:1.23	Mon Sep 18 15:04:57 2000
+++ eggdrop1.6/src/dccutil.c	Sun Dec 10 09:10:27 2000
@@ -6,7 +6,7 @@
  *   memory management for dcc structures
  *   timeout checking for dcc connections
  * 
- * $Id: dccutil.c,v 1.23 2000/09/18 20:04:57 fabian Exp $
+ * $Id: dccutil.c,v 1.24 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -71,7 +71,6 @@
 {
   int tot, i;
 
-  Context;
   tot = sizeof(struct dcc_t) * max_dcc + sizeof(sock_list) * MAXSOCKS;
 
   for (i = 0; i < dcc_total; i++) {
@@ -217,7 +216,6 @@
 	i = 0;
       dcc[idx].u.chat->channel = i;
       if (dcc[idx].u.chat->channel >= 0) {
-	Context;
 	if (dcc[idx].u.chat->channel < 100000) {
 	  botnet_send_join_idx(idx, -1);
 	}
@@ -226,7 +224,7 @@
 		     geticon(idx), dcc[idx].sock, dcc[idx].host);
     }
     /* But *do* bother with sending it locally */
-    if (dcc[idx].u.chat->channel == 0) {
+    if (!dcc[idx].u.chat->channel) {
       chanout_but(-1, 0, "*** %s joined the party line.\n", dcc[idx].nick);
     } else if (dcc[idx].u.chat->channel > 0) {
       chanout_but(-1, dcc[idx].u.chat->channel,
@@ -276,7 +274,6 @@
 {
   int i;
 
-  Context;
   for (i = 0; i < dcc_total; i++) {
     if (dcc[i].type == &DCC_LOST) {
       dcc[i].type = NULL;
@@ -295,7 +292,6 @@
   int i, j, k;
   char other[160];
 
-  Context;
   spaces[HANDLEN - 9] = 0;
   dprintf(zidx, "SOCK ADDR     PORT  NICK     %s HOST              TYPE\n"
 	  ,spaces);
@@ -327,7 +323,6 @@
  */
 void not_away(int idx)
 {
-  Context;
   if (dcc[idx].u.chat->away == NULL) {
     dprintf(idx, "You weren't away!\n");
     return;
@@ -335,7 +330,6 @@
   if (dcc[idx].u.chat->channel >= 0) {
     chanout_but(-1, dcc[idx].u.chat->channel,
 		"*** %s is no longer away.\n", dcc[idx].nick);
-    Context;
     if (dcc[idx].u.chat->channel < 100000) {
       botnet_send_away(-1, botnetnick, dcc[idx].sock, NULL, idx);
     }
@@ -363,7 +357,6 @@
   if (dcc[idx].u.chat->channel >= 0) {
     chanout_but(-1, dcc[idx].u.chat->channel,
 		"*** %s is now away: %s\n", dcc[idx].nick, s);
-    Context;
     if (dcc[idx].u.chat->channel < 100000) {
       botnet_send_away(-1, botnetnick, dcc[idx].sock, s, idx);
     }
@@ -381,7 +374,7 @@
   char x[1024];
 
   p = strrchr(file, '/');
-  simple_sprintf(x, "dccutil.c:%s", p ? p + 1 : file);
+  egg_snprintf(x, sizeof x, "dccutil.c:%s", p ? p + 1 : file);
   p = n_malloc(size, x, line);
 #else
   p = nmalloc(size);
@@ -464,7 +457,7 @@
 {
   time_t t;
 
-  if (dcc_flood_thr == 0)
+  if (!dcc_flood_thr)
     return 0;
   t = now;
   if (*timer != t) {
@@ -480,7 +473,7 @@
 	  (chat->channel >= 0)) {
 	char x[1024];
 
-	simple_sprintf(x, DCC_FLOODBOOT, dcc[idx].nick);
+	egg_snprintf(x, sizeof x, DCC_FLOODBOOT, dcc[idx].nick);
 	chanout_but(idx, chat->channel, "*** %s", x);
 	if (chat->channel < 100000)
 	  botnet_send_part_idx(idx, x);
@@ -515,8 +508,8 @@
       (dcc[idx].u.chat->channel >= 0)) {
     char x[1024];
 
-    simple_sprintf(x, DCC_BOOTED3, by, dcc[idx].nick, reason[0] ? ": " : "",
-                   reason);
+    egg_snprintf(x, sizeof x, DCC_BOOTED3, by, dcc[idx].nick, 
+		 reason[0] ? ": " : "", reason);
     chanout_but(idx, dcc[idx].u.chat->channel, "*** %s.\n", x);
     if (dcc[idx].u.chat->channel < 100000)
       botnet_send_part_idx(idx, x);
Index: eggdrop1.6/src/dns.c
diff -u eggdrop1.6/src/dns.c:1.18 eggdrop1.6/src/dns.c:1.19
--- eggdrop1.6/src/dns.c:1.18	Sat Sep  9 06:39:09 2000
+++ eggdrop1.6/src/dns.c	Sun Dec 10 09:10:27 2000
@@ -4,7 +4,7 @@
  *   provides the code used by the bot if the DNS module is not loaded
  *   DNS Tcl commands
  * 
- * $Id: dns.c,v 1.18 2000/09/09 11:39:09 fabian Exp $
+ * $Id: dns.c,v 1.19 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Written by Fabian Knittel <fknittel at gmx.de>
@@ -52,12 +52,10 @@
 void dcc_dnswait(int idx, char *buf, int len)
 {
   /* Ignore anything now. */
-  Context;
 }
 
 void eof_dcc_dnswait(int idx)
 {
-  Context;
   putlog(LOG_MISC, "*", "Lost connection while resolving hostname [%s/%d]",
 	 iptostr(dcc[idx].addr), dcc[idx].port);
   killsock(dcc[idx].sock);
@@ -74,7 +72,6 @@
   register struct dns_info *p = (struct dns_info *) x;
   int size = 0;
 
-  Context;
   if (p) {
     size = sizeof(struct dns_info);
     if (p->host)
@@ -89,7 +86,6 @@
 {
   register struct dns_info *p = (struct dns_info *) x;
 
-  Context;
   if (p) {
     if (p->host)
       nfree(p->host);
@@ -125,7 +121,6 @@
 {
   int idx;
 
-  Context;
   for (idx = 0; idx < dcc_total; idx++) {
     if ((dcc[idx].type == &DCC_DNSWAIT) &&
         (dcc[idx].u.dns->dns_type == RES_HOSTBYIP) &&
@@ -149,7 +144,6 @@
 {
   int idx;
 
-  Context;
   for (idx = 0; idx < dcc_total; idx++) {
     if ((dcc[idx].type == &DCC_DNSWAIT) &&
         (dcc[idx].u.dns->dns_type == RES_IPBYHOST) &&
@@ -184,7 +178,6 @@
 {
   devent_t *de = dns_events;
 
-  Context;
   while (de) {
     if (de->type && (de->type == &DNS_DCCEVENT_IPBYHOST) &&
 	(de->lookup == RES_IPBYHOST)) {
@@ -216,7 +209,6 @@
 {
   devent_t *de = dns_events;
 
-  Context;
   while (de) {
     if (de->type && (de->type == &DNS_DCCEVENT_HOSTBYIP) &&
 	(de->lookup == RES_HOSTBYIP)) {
@@ -251,7 +243,6 @@
 {
   devent_tclinfo_t *tclinfo = (devent_tclinfo_t *) other;
   
-  Context;
   if (Tcl_VarEval(interp, tclinfo->proc, " ", iptostr(htonl(ip)), " ",
 		  hostn, ok ? " 1" : " 0", tclinfo->paras, NULL) == TCL_ERROR)
     putlog(LOG_MISC, "*", DCC_TCLERROR, tclinfo->proc, interp->result);
@@ -295,7 +286,6 @@
   devent_t *de;
   devent_tclinfo_t *tclinfo;
 
-  Context;
   de = nmalloc(sizeof(devent_t));
   egg_bzero(de, sizeof(devent_t));
 
@@ -328,7 +318,6 @@
   devent_t *de;
   devent_tclinfo_t *tclinfo;
 
-  Context;
   de = nmalloc(sizeof(devent_t));
   egg_bzero(de, sizeof(devent_t));
 
@@ -365,7 +354,6 @@
   devent_t *de = dns_events;
   int tot = 0;
 
-  Context;
   while (de) {
     tot += sizeof(devent_t);
     if ((de->lookup == RES_IPBYHOST) && de->res_data.hostname)
@@ -381,7 +369,6 @@
 {
   devent_t *de = dns_events, *ode = NULL, *nde = NULL;
 
-  Context;
   while (de) {
     nde = de->next;
     if ((de->lookup == RES_HOSTBYIP) &&
@@ -410,7 +397,6 @@
 {
   devent_t *de = dns_events, *ode = NULL, *nde = NULL;
 
-  Context;
   while (de) {
     nde = de->next;
     if ((de->lookup == RES_IPBYHOST) &&
@@ -450,14 +436,12 @@
   unsigned long addr = htonl(ip);
   static char s[UHOSTLEN];
 
-  Context;
   if (!setjmp(alarmret)) {
     alarm(resolve_timeout);
     hp = gethostbyaddr((char *) &addr, sizeof(addr), AF_INET);
     alarm(0);
     if (hp) {
-      strncpy(s, hp->h_name, UHOSTLEN - 1);
-      s[UHOSTLEN - 1] = 0;
+      strncpyz(s, hp->h_name, sizeof s);
     } else
       strcpy(s, iptostr(addr));
   } else {
@@ -466,14 +450,12 @@
   }
   /* Call hooks. */
   call_hostbyip(ip, s, hp ? 1 : 0);
-  Context;
 }
 
 void block_dns_ipbyhost(char *host)
 {
   struct in_addr inaddr;
 
-  Context;
   /* Check if someone passed us an IP address as hostname 
    * and return it straight away */
   if (egg_inet_aton(host, &inaddr)) {
@@ -498,7 +480,6 @@
     /* Fall through. */
   }
   call_ipbyhost(host, 0, 0);
-  Context;
 }
 
 
@@ -522,7 +503,6 @@
   struct in_addr inaddr;
   char *paras = NULL;
  
-  Context;
   if (argc < 3) {
     Tcl_AppendResult(irp, "wrong # args: should be \"", argv[0],
 		     " ip-address/hostname proc ?args...?\"", NULL);
Index: eggdrop1.6/src/flags.c
diff -u eggdrop1.6/src/flags.c:1.16 eggdrop1.6/src/flags.c:1.17
--- eggdrop1.6/src/flags.c:1.16	Fri Nov 10 13:39:38 2000
+++ eggdrop1.6/src/flags.c	Sun Dec 10 09:10:27 2000
@@ -2,7 +2,7 @@
  * flags.c -- handles:
  *   all the flag matching/conversion functions in one neat package :)
  * 
- * $Id: flags.c,v 1.16 2000/11/10 19:39:38 guppy Exp $
+ * $Id: flags.c,v 1.17 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -358,7 +358,7 @@
       break;
     case '|':
     case '&':
-      if (mode == 0) {
+      if (!mode) {
 	if (*string == '|')
 	  plus->match = FR_OR;
 	else
@@ -637,8 +637,7 @@
 
       cr->next = u->chanrec;
       u->chanrec = cr;
-      strncpy(cr->channel, chname, 80);
-      cr->channel[80] = 0;
+      strncpyz(cr->channel, chname, sizeof cr->channel);
     }
     if (cr && ch) {
       cr->flags = fr->chan;
@@ -704,9 +703,6 @@
 {
   struct flag_record fr = {FR_BOT, 0, 0, 0, 0, 0};
  
-  Context;
-  Assert(e);
-  Assert(e->name);
   break_down_flags(e->u.list->extra, &fr, NULL);
   list_type_kill(e->u.list);
   e->u.ulong = fr.bot;
@@ -728,7 +724,6 @@
 
 static int botfl_kill(struct user_entry *e)
 {
-  Context;
   nfree(e);
   return 1;
 }
@@ -739,7 +734,6 @@
   char x[100];
   struct flag_record fr = {FR_BOT, 0, 0, 0, 0, 0};
 
-  Context;
   fr.bot = e->u.ulong;
   build_flags(x, &fr, NULL);
   if (fprintf(f, "--%s %s\n", e->type->name, x) == EOF)
@@ -751,7 +745,6 @@
 {
   register long atr = ((long) buf & BOT_VALID);
 
-  Context;
   if (!(u->flags & USER_BOT))
     return 1;			/* Don't even bother trying to set the
 				   flags for a non-bot */
@@ -769,7 +762,6 @@
   if (!(atr & BOT_SHARE))
     atr &= ~BOT_GLOBAL;
   e->u.ulong = atr;
-  Context;
   return 1;
 }
 
@@ -801,7 +793,6 @@
 
 static int botfl_expmem(struct user_entry *e)
 {
-  Context;
   return 0;
 }
 
@@ -810,7 +801,6 @@
   struct flag_record fr = {FR_BOT, 0, 0, 0, 0, 0};
   char x[100];
 
-  Context;
   fr.bot = e->u.ulong;
   build_flags(x, &fr, NULL);
   dprintf(idx, "  BOT FLAGS: %s\n", x);
Index: eggdrop1.6/src/language.c
diff -u eggdrop1.6/src/language.c:1.10 eggdrop1.6/src/language.c:1.11
--- eggdrop1.6/src/language.c:1.10	Wed Apr  5 14:35:43 2000
+++ eggdrop1.6/src/language.c	Sun Dec 10 09:10:27 2000
@@ -2,7 +2,7 @@
  * language.c -- handles:
  *   language support code
  * 
- * $Id: language.c,v 1.10 2000/04/05 19:35:43 fabian Exp $
+ * $Id: language.c,v 1.11 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -109,7 +109,6 @@
 {
   lang_pri *lp = langpriority, *lpo = NULL;
 
-  Context;
   while (lp) {
     /* The language already exists, moving to the beginning */
     if (!strcmp(lang, lp->lang)) {
@@ -144,7 +143,6 @@
 {
   lang_pri *lp = langpriority, *lpo = NULL;
 
-  Context;
   while (lp) {
     /* Found the language? */
     if (!strcmp(lang, lp->lang)) {
@@ -200,7 +198,6 @@
   lang_sec *ls = langsection;
   char *langfile;
 
-  Context;
   while (ls) {
     if (ls->section) {
       langfile = get_langfile(ls);
@@ -228,7 +225,6 @@
   int ltexts = 0;
   int ladd = 0, lupdate = 0;
 
-  Context;
   FLANG = fopen(langfile, "r");
   if (FLANG == NULL) {
     putlog(LOG_MISC, "*", "LANG: unexpected: reading from file %s failed.",
@@ -318,7 +314,6 @@
   lang_sec	*ls, *ols = NULL;
   int		 ok = 0;
 
-  Context;
   for (ls = langsection; ls; ols = ls, ls = ls->next)
     /* Already know of that section? */
     if (!strcmp(section, ls->section))
@@ -407,7 +402,6 @@
   char *langfile;
   lang_pri *lp;
 
-  Context;
   for (lp = langpriority; lp; lp = lp->next) {
     /* There is no need to reload the same language */
     if (sec->lang && !strcmp(sec->lang, lp->lang))
@@ -431,7 +425,6 @@
 {
   char *p;
 
-  Context;
   p = strrchr(par, '/');
   /* path attached? */
   if (p)
@@ -456,7 +449,6 @@
 {
   char *section, *lang, *buf;
 
-  Context;
   dprintf(idx, "Note: This command is obsoleted by +lang.\n");
   if (!par || !par[0]) {
     dprintf(idx, "Usage: language <section>.<language>\n");
@@ -480,7 +472,6 @@
 
 static int cmd_plslang(struct userrec *u, int idx, char *par)
 {
-  Context;
   if (!par || !par[0]) {
     dprintf(idx, "Usage: +lang <language>\n");
     return 0;
@@ -493,7 +484,6 @@
 
 static int cmd_mnslang(struct userrec *u, int idx, char *par)
 {
-  Context;
   if (!par || !par[0]) {
     dprintf(idx, "Usage: -lang <language>\n");
     return 0;
@@ -508,7 +498,6 @@
 
 static int cmd_plslsec(struct userrec *u, int idx, char *par)
 {
-  Context;
   if (!par || !par[0]) {
     dprintf(idx, "Usage: +lsec <section>\n");
     return 0;
@@ -520,7 +509,6 @@
 
 static int cmd_mnslsec(struct userrec *u, int idx, char *par)
 {
-  Context;
   if (!par || !par[0]) {
     dprintf(idx, "Usage: -lsec <section>\n");
     return 0;
@@ -544,7 +532,6 @@
   char ltext2[512];
   int idx2, i;
 
-  Context;
   putlog(LOG_CMDS, "*", "#%s# ldump %s", dcc[idx].nick, par);
   if (par[0]) {
     /* atoi (hence strtol) don't work right here for hex */
@@ -575,7 +562,7 @@
       return l->text;
     l = l->next;
   }
-  sprintf(text, "MSG%03X", idx);
+  egg_snprintf(text, sizeof text, "MSG%03X", idx);
   return text;
 }
 
@@ -586,7 +573,6 @@
   lang_pri *lp;
   int i, size = 0;
 
-  Context;
   for (i = 0; i < 64; i++)
     for (l = langtab[i]; l; l = l->next) {
       size += sizeof(lang_tab);
@@ -617,7 +603,6 @@
   lang_sec *ls = langsection;
   lang_pri *lp = langpriority;
 
-  Context;
   putlog(LOG_CMDS, "*", "#%s# lstat %s", dcc[idx].nick, par);
   for (i = 0; i < 64; i++) {
     c = 0;
@@ -631,7 +616,6 @@
       empty++;
     ltexts += c;
   }
-  Context;
   dprintf(idx, "Language code report:\n");
   dprintf(idx, "   Table size   : %d bytes\n", expmem_language());
   dprintf(idx, "   Text messages: %d\n", ltexts);
@@ -760,7 +744,6 @@
   int i;
   char *deflang;
 
-  Context;
   if (flag) {
     for (i = 0; i < 32; i++)
       langtab[i] = 0;
Index: eggdrop1.6/src/main.c
diff -u eggdrop1.6/src/main.c:1.48 eggdrop1.6/src/main.c:1.49
--- eggdrop1.6/src/main.c:1.48	Wed Nov 22 21:56:40 2000
+++ eggdrop1.6/src/main.c	Sun Dec 10 09:10:27 2000
@@ -5,7 +5,7 @@
  *   command line arguments
  *   context and assert debugging
  * 
- * $Id: main.c,v 1.48 2000/11/23 03:56:40 guppy Exp $
+ * $Id: main.c,v 1.49 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -46,6 +46,7 @@
 /* Some systems have a working sys/wait.h even though configure will
  * decide it's not bsd compatable.  Oh well.
  */
+
 #include "chan.h"
 #include "modules.h"
 #include "tandem.h"
@@ -103,7 +104,7 @@
 int	make_userfile = 0;	/* Using bot in make-userfile mode? (first
 				   user to 'hello' becomes master) */
 char	owner[121] = "";	/* Permanent owner(s) of the bot */
-char	pid_file[40];		/* Name of the file for the pid to be
+char	pid_file[HANDLEN + 5];		/* Name of the file for the pid to be
 				   stored in */
 int	save_users_at = 0;	/* How many minutes past the hour to
 				   save the userfile? */
@@ -181,7 +182,6 @@
 {
   int tot;
 
-  Context;
   tot = expmem_chanprog() + expmem_users() + expmem_misc() +
     expmem_dccutil() + expmem_botnet() + expmem_tcl() + expmem_tclhash() +
     expmem_net() + expmem_modules(0) + expmem_language() + expmem_tcldcc();
@@ -212,7 +212,7 @@
 void write_debug()
 {
   int x;
-  char s[80];
+  char s[25];
   int y;
 
   if (nested_debug) {
@@ -225,7 +225,7 @@
     x = creat("DEBUG.DEBUG", 0644);
     setsock(x, SOCK_NONSOCK);
     if (x >= 0) {
-      strcpy(s, ctime(&now));
+      strncpyz(s, ctime(&now), sizeof s);
       dprintf(-x, "Debug (%s) written %s", ver, s);
       dprintf(-x, "Please report problem to eggheads at eggheads.org");
       dprintf(-x, "after a visit to http://www.eggheads.org/bugs.html");
@@ -252,14 +252,13 @@
   if (x < 0) {
     putlog(LOG_MISC, "*", "* Failed to write DEBUG");
   } else {
-    strcpy(s, ctime(&now));
+    strncpyz(s, ctime(&now), sizeof s);
     dprintf(-x, "Debug (%s) written %s", ver, s);
     dprintf(-x, "Full Patch List: %s\n", egg_xtra);
 #ifdef STATIC
     dprintf(-x, "STATICALLY LINKED\n");
 #endif
-    strcpy(s, "info library");
-    if (interp && (Tcl_Eval(interp, s) == TCL_OK))
+    if (interp && (Tcl_Eval(interp, "info library") == TCL_OK))
       dprintf(-x, "Using tcl library: %s (header version %s)\n",
 	      interp->result, TCL_VERSION);
     dprintf(-x, "Compile flags: %s\n", CCFLAGS);
@@ -377,8 +376,7 @@
 
   p = strrchr(file, '/');
   if (!module) {
-    strncpy(x, p ? p + 1 : file, 30);
-    x[30] = 0;
+    strncpyz(x, p ? p + 1 : file, sizeof x);
   } else
     egg_snprintf(x, 31, "%s:%s", module, p ? p + 1 : file);
   cx_ptr = ((cx_ptr + 1) & 15);
@@ -396,15 +394,13 @@
 
   p = strrchr(file, '/');
   if (!module) {
-    strncpy(x, p ? p + 1 : file, 30);
-    x[30] = 0;
+    strncpyz(x, p ? p + 1 : file, sizeof x);
   } else
     egg_snprintf(x, 31, "%s:%s", module, p ? p + 1 : file);
   cx_ptr = ((cx_ptr + 1) & 15);
   strcpy(cx_file[cx_ptr], x);
   cx_line[cx_ptr] = line;
-  strncpy(cx_note[cx_ptr], note, 255);
-  cx_note[cx_ptr][255] = 0;
+  strncpyz(cx_note[cx_ptr], note, sizeof cx_note[cx_ptr]);
 }
 #endif
 
@@ -426,26 +422,28 @@
 
 static void do_arg(char *s)
 {
+  char x[1024], *z = x;
   int i;
 
   if (s[0] == '-')
     for (i = 1; i < strlen(s); i++) {
-      if (s[i] == 'n')
+      switch (s[i]) {
+	case 'n':
 	backgrd = 0;
-      if (s[i] == 'c') {
+	  break;
+        case 'c':
 	con_chan = 1;
 	term_z = 0;
-      }
-      if (s[i] == 't') {
+	  break;
+	case 't':
 	con_chan = 0;
 	term_z = 1;
-      }
-      if (s[i] == 'm')
+	  break;
+	case 'm':
 	make_userfile = 1;
-      if (s[i] == 'v') {
-	char x[256], *z = x;
-
-	strcpy(x, egg_version);
+	  break;
+	case 'v':
+	  strncpyz(x, egg_version, sizeof x);
 	newsplit(&z);
 	newsplit(&z);
 	printf("%s\n", version);
@@ -453,25 +451,25 @@
 	  printf("  (patches: %s)\n", z);
 	bg_send_quit(BG_ABORT);
 	exit(0);
-      }
-      if (s[i] == 'h') {
+ 	  break; /* this should never be reached */
+	case 'h':
 	printf("\n%s\n\n", version);
 	printf(EGG_USAGE);
 	printf("\n");
 	bg_send_quit(BG_ABORT);
 	exit(0);
+	  break; /* this should never be reached */
       }
   } else
-    strcpy(configfile, s);
+    strncpyz(configfile, s, sizeof configfile);
 }
 
 void backup_userfile(void)
 {
-  char s[150];
+  char s[125];
 
   putlog(LOG_MISC, "*", USERF_BACKUP);
-  strcpy(s, userfile);
-  strcat(s, "~bak");
+  egg_snprintf(s, sizeof s, "%s~bak", userfile);
   copyfile(userfile, s);
 }
 
@@ -525,15 +523,15 @@
     if (((int) (nowtm.tm_min / 5) * 5) == (nowtm.tm_min)) {	/* 5 min */
       call_hook(HOOK_5MINUTELY);
       check_botnet_pings();
-      if (quick_logs == 0) {
+      if (!quick_logs) {
 	flushlogs();
 	check_logsize();
       }
-      if (miltime == 0) {	/* At midnight */
-	char s[128];
+      if (!miltime) {	/* At midnight */
+	char s[25];
 	int j;
 
-	s[my_strcpy(s, ctime(&now)) - 1] = 0;
+	strncpyz(s, ctime(&now), sizeof s);
 	putlog(LOG_ALL, "*", "--- %.11s%s", s, s + 20);
 	backup_userfile();
 	for (j = 0; j < max_logs; j++) {
@@ -561,7 +559,7 @@
 	      fclose(logs[i].f);
 	      logs[i].f = NULL;
 	    }
-	    simple_sprintf(s, "%s.yesterday", logs[i].filename);
+	    egg_snprintf(s, sizeof s, "%s.yesterday", logs[i].filename);
 	    unlink(s);
 	    movefile(logs[i].filename, s);
 	  }
@@ -582,37 +580,31 @@
 
 static void core_hourly()
 {
-  Context;
   write_userfile(-1);
 }
 
 static void event_rehash()
 {
-  Context;
   check_tcl_event("rehash");
 }
 
 static void event_prerehash()
 {
-  Context;
   check_tcl_event("prerehash");
 }
 
 static void event_save()
 {
-  Context;
   check_tcl_event("save");
 }
 
 static void event_logfile()
 {
-  Context;
   check_tcl_event("logfile");
 }
 
 static void event_resettraffic()
 {
-  Context;
   otraffic_irc += otraffic_irc_today;
   itraffic_irc += itraffic_irc_today;
   otraffic_bn += otraffic_bn_today;
@@ -667,7 +659,7 @@
 int main(int argc, char **argv)
 {
   int xx, i;
-  char buf[520], s[520];
+  char buf[520], s[25];
   FILE *f;
   struct sigaction sv;
   struct chanset_t *chan;
@@ -692,13 +684,13 @@
 
 #include "patch.h"
   /* Version info! */
-  sprintf(ver, "eggdrop v%s", egg_version);
-  sprintf(version, "Eggdrop v%s  (c)1997 Robey Pointer (c)1999, 2000  Eggheads",
+  egg_snprintf(ver, sizeof ver, "eggdrop v%s", egg_version);
+  egg_snprintf(version, sizeof version, 
+	       "Eggdrop v%s  (c)1997 Robey Pointer (c)1999, 2000  Eggheads",
      egg_version);
   /* Now add on the patchlevel (for Tcl) */
   sprintf(&egg_version[strlen(egg_version)], " %u", egg_numver);
   strcat(egg_version, egg_xtra);
-  Context;
 #ifdef STOP_UAC
   {
     int nvpair[2];
@@ -763,14 +755,11 @@
 #ifdef STATIC
   link_statics();
 #endif
-  Context;
-  strcpy(s, ctime(&now));
-  s[strlen(s) - 1] = 0;
+  strncpyz(s, ctime(&now), sizeof s);
   strcpy(&s[11], &s[20]);
   putlog(LOG_ALL, "*", "--- Loading %s (%s)", ver, s);
   chanprog();
-  Context;
-  if (encrypt_pass == 0) {
+  if (!encrypt_pass) {
     printf(MOD_NOCRYPT);
     bg_send_quit(BG_ABORT);
     exit(1);
@@ -782,8 +771,7 @@
 	 botnetnick, i, count_users(userlist));
   cache_miss = 0;
   cache_hit = 0;
-  sprintf(pid_file, "pid.%s", botnetnick);
-  Context;
+  egg_snprintf(pid_file, sizeof pid_file, "pid.%s", botnetnick);
 
   /* Check for pre-existing eggdrop! */
   f = fopen(pid_file, "r");
@@ -799,7 +787,6 @@
       exit(1);
     }
   }
-  Context;
 
   /* Move into background? */
   if (backgrd) {
@@ -888,7 +875,6 @@
   while (1) {
     int socket_cleanup = 0;
 
-    Context;
 #if !defined(HAVE_PRE7_5_TCL)
     /* Process a single tcl event */
     Tcl_DoOneEvent(TCL_ALL_EVENTS | TCL_DONT_WAIT);
@@ -904,7 +890,6 @@
       then = now;
     }
 
-    Context;
     /* Only do this every so often. */
     if (!socket_cleanup) {
       socket_cleanup = 5;
@@ -956,7 +941,6 @@
 
       if (i == STDOUT && !backgrd)
 	fatal("END OF FILE ON TERMINAL", 0);
-      Context;
       for (idx = 0; idx < dcc_total; idx++)
 	if (dcc[idx].sock == i) {
 	  if (dcc[idx].type && dcc[idx].type->eof)
@@ -977,7 +961,6 @@
 	killsock(i);
       }
     } else if (xx == -2 && errno != EINTR) {	/* select() error */
-      Context;
       putlog(LOG_MISC, "*", "* Socket error #%d; recovering.", errno);
       for (i = 0; i < dcc_total; i++) {
 	if ((fcntl(dcc[i].sock, F_GETFD, 0) == -1) && (errno = EBADF)) {
@@ -1029,9 +1012,7 @@
 	  /* Should be only 2 modules now - blowfish (or some other
 	     encryption module) and eggdrop. */
 	  putlog(LOG_MISC, "*", MOD_STAGNANT);
-	Context;
 	flushlogs();
-	Context;
 	kill_tcl();
 	init_tcl(argc, argv);
 	init_language(0);
Index: eggdrop1.6/src/mem.c
diff -u eggdrop1.6/src/mem.c:1.13 eggdrop1.6/src/mem.c:1.14
--- eggdrop1.6/src/mem.c:1.13	Fri Oct 27 14:32:41 2000
+++ eggdrop1.6/src/mem.c	Sun Dec 10 09:10:27 2000
@@ -3,7 +3,7 @@
  *   memory allocation and deallocation
  *   keeping track of what memory is being used by whom
  * 
- * $Id: mem.c,v 1.13 2000/10/27 19:32:41 fabian Exp $
+ * $Id: mem.c,v 1.14 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -145,29 +145,29 @@
     if (p)
       *p = 0;
     l = memtbl[i].size;
-    if (!egg_strcasecmp(fn, "language.c"))
+    if (!strcmp(fn, "language.c"))
       use[0] += l;
-    else if (!egg_strcasecmp(fn, "chanprog.c"))
+    else if (!strcmp(fn, "chanprog.c"))
       use[1] += l;
-    else if (!egg_strcasecmp(fn, "misc.c"))
+    else if (!strcmp(fn, "misc.c"))
       use[2] += l;
-    else if (!egg_strcasecmp(fn, "userrec.c"))
+    else if (!strcmp(fn, "userrec.c"))
       use[3] += l;
-    else if (!egg_strcasecmp(fn, "net.c"))
+    else if (!strcmp(fn, "net.c"))
       use[4] += l;
-    else if (!egg_strcasecmp(fn, "dccutil.c"))
+    else if (!strcmp(fn, "dccutil.c"))
       use[5] += l;
-    else if (!egg_strcasecmp(fn, "botnet.c"))
+    else if (!strcmp(fn, "botnet.c"))
       use[6] += l;
-    else if (!egg_strcasecmp(fn, "tcl.c"))
+    else if (!strcmp(fn, "tcl.c"))
       use[7] += l;
-    else if (!egg_strcasecmp(fn, "tclhash.c"))
+    else if (!strcmp(fn, "tclhash.c"))
       use[8] += l;
-    else if (!egg_strcasecmp(fn, "modules.c"))
+    else if (!strcmp(fn, "modules.c"))
       use[9] += l;
-    else if (!egg_strcasecmp(fn, "tcldcc.c"))
+    else if (!strcmp(fn, "tcldcc.c"))
       use[10] += l;
-    else if (!egg_strcasecmp(fn, "dns.c"))
+    else if (!strcmp(fn, "dns.c"))
       use[11] += l;
     else if (p) {
       for (me = module_list; me; me = me->next)
Index: eggdrop1.6/src/misc.c
diff -u eggdrop1.6/src/misc.c:1.31 eggdrop1.6/src/misc.c:1.32
--- eggdrop1.6/src/misc.c:1.31	Mon Nov 20 22:46:17 2000
+++ eggdrop1.6/src/misc.c	Sun Dec 10 09:10:27 2000
@@ -7,7 +7,7 @@
  *   help system
  *   motd display and %var substitution
  * 
- * $Id: misc.c,v 1.31 2000/11/21 04:46:17 guppy Exp $
+ * $Id: misc.c,v 1.32 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -231,7 +231,7 @@
   }
   *p = 0;
   if (first != NULL)
-    strncpy(first, rest, max), first[max] = 0;
+    strncpyz(first, rest, max);
   if (first != rest)
     /*    In most circumstances, strcpy with src and dst being the same buffer
      *  can produce undefined results. We're safe here, as the src is
@@ -427,7 +427,7 @@
   if (now - then > 86400) {
     int days = (now - then) / 86400;
 
-    sprintf(out, "%d day%s ago", days, (days == 1) ? "" : "s");
+    egg_snprintf(out, sizeof out, "%d day%s ago", days, (days == 1) ? "" : "s");
     return;
   }
   egg_strftime(out, 6, "%H:%M", localtime(&then));
@@ -441,7 +441,7 @@
   if (now - then > 86400) {
     int days = (now - then) / 86400;
 
-    sprintf(out, "in %d day%s", days, (days == 1) ? "" : "s");
+    egg_snprintf(out, sizeof out, "in %d day%s", days, (days == 1) ? "" : "s");
     return;
   }
   egg_strftime(out, 9, "at %H:%M", localtime(&now));
@@ -452,21 +452,18 @@
  */
 void daysdur(time_t now, time_t then, char *out)
 {
-  char s[81];
   int hrs, mins;
 
   if (now - then > 86400) {
     int days = (now - then) / 86400;
 
-    sprintf(out, "for %d day%s", days, (days == 1) ? "" : "s");
+    egg_snprintf(out, sizeof out, "for %d day%s", days, (days == 1) ? "" : "s");
     return;
   }
-  strcpy(out, "for ");
   now -= then;
   hrs = (int) (now / 3600);
   mins = (int) ((now - (hrs * 3600)) / 60);
-  sprintf(s, "%02d:%02d", hrs, mins);
-  strcat(out, s);
+  egg_snprintf(out, sizeof out, "for %02d:%02d", hrs, mins);
 }
 
 
@@ -561,8 +558,7 @@
 	       */
 	    }
 	    fputs(out, logs[i].f);
-	    strncpy(logs[i].szlast, out + 8, LOGLINEMAX);
-	    logs[i].szlast[LOGLINEMAX] = 0;
+	    strncpyz(logs[i].szlast, out + 8, LOGLINEMAX);
 	  }
 	}
       }
@@ -592,7 +588,6 @@
   int	 i;
   char	*s2 = logfile_suffix;
 
-  Context;
   debug0("Logfile suffix changed. Closing all open logs.");
   strcpy(logfile_suffix, s);
   while (s2[0]) {
@@ -616,51 +611,29 @@
 /* int x=1; */
   char buf[1024];		/* Should be plenty */
 
-  Context;
-  if ((keep_all_logs == 0) && (max_logsize != 0)) {
+  if (!keep_all_logs && max_logsize > 0) {
     for (i = 0; i < max_logs; i++) {
       if (logs[i].filename) {
 	if (stat(logs[i].filename, &ss) != 0) {
 	  break;
 	}
 	if ((ss.st_size >> 10) > max_logsize) {
-	  Context;
 	  if (logs[i].f) {
 	    /* write to the log before closing it huh.. */
 	    putlog(LOG_MISC, "*", MISC_CLOGS, logs[i].filename, ss.st_size);
 	    fflush(logs[i].f);
 	    fclose(logs[i].f);
 	    logs[i].f = NULL;
-	    Context;
 	  }
-	  Context;
 
-	  simple_sprintf(buf, "%s.yesterday", logs[i].filename);
+	  egg_snprintf(buf, sizeof buf, "%s.yesterday", logs[i].filename);
 	  buf[1023] = 0;
 	  unlink(buf);
-/* x++; 
- * This is an alternate method i was considering, i want to leave
- * this in here and commented.. in case someone wants it like this
- * it really depends on feedback from the users. - poptix
- * feel free to ask me, if you have questions on this.. 
- * 
- * while (x > 0) {
- * x++;
- * * only YOU can prevent buffer overflows! *
- * simple_sprintf(buf,"%s.%d",logs[i].filename,x);
- * buf[1023] = 0;
- * if (stat(buf,&ss) == -1) { 
- * * file doesnt exist, lets use it *
- */
 	  movefile(logs[i].filename, buf);
-/* x=0;
- * }
- * } */
 	}
       }
     }
   }
-  Context;
 }
 
 /* Flush the logfiles to disk
@@ -670,7 +643,6 @@
   int i;
   struct tm *t = localtime(&now);
 
-  Context;
   /* Logs may not be initialised yet. */
   if (!logs)
     return;
@@ -697,7 +669,6 @@
       fflush(logs[i].f);
     }
   }
-  Context;
 }
 
 
@@ -796,8 +767,7 @@
     help_flags = isdcc;
     return;
   }
-  strncpy(xx, s, HELP_BUF_LEN);
-  xx[HELP_BUF_LEN] = 0;
+  strncpyz(xx, s, sizeof xx);
   readidx = xx;
   writeidx = s;
   current = strchr(readidx, '%');
@@ -877,7 +847,7 @@
     case 'U':
 #ifdef HAVE_UNAME
       if (!uname(&uname_info)) {
-	simple_sprintf(sub, "%s %s", uname_info.sysname,
+	egg_snprintf(sub, sizeof sub, "%s %s", uname_info.sysname,
 		       uname_info.release);
 	towrite = sub;
       } else
@@ -1077,11 +1047,11 @@
   current->next = help_list;
   current->first = NULL;
   help_list = current;
-  simple_sprintf(s, "%smsg/%s", helpdir, file);
+  egg_snprintf(s, sizeof s, "%smsg/%s", helpdir, file);
   scan_help_file(current, s, 0);
-  simple_sprintf(s, "%s%s", helpdir, file);
+  egg_snprintf(s, sizeof s, "%s%s", helpdir, file);
   scan_help_file(current, s, 1);
-  simple_sprintf(s, "%sset/%s", helpdir, file);
+  egg_snprintf(s, sizeof s, "%sset/%s", helpdir, file);
   scan_help_file(current, s, 2);
 }
 
@@ -1154,14 +1124,14 @@
       for (item = current->first; item; item = item->next)
 	if (!strcmp(item->name, file)) {
 	  if (!item->type && !dcc) {
-	    simple_sprintf(s, "%smsg/%s", helpdir, current->name);
+	    egg_snprintf(s, sizeof s, "%smsg/%s", helpdir, current->name);
 	    if ((f = fopen(s, "r")))
 	      return f;
 	  } else if (dcc && item->type) {
 	    if (item->type == 1)
-	      simple_sprintf(s, "%s%s", helpdir, current->name);
+	      egg_snprintf(s, sizeof s, "%s%s", helpdir, current->name);
 	    else
-	      simple_sprintf(s, "%sset/%s", helpdir, current->name);
+	      egg_snprintf(s, sizeof s, "%sset/%s", helpdir, current->name);
 	    if ((f = fopen(s, "r")))
 	      return f;
 	  }
@@ -1274,9 +1244,9 @@
     for (item = current->first; item; item = item->next)
       if (wild_match(match, item->name) && item->type) {
 	if (item->type == 1)
-	  simple_sprintf(s, "%s%s", helpdir, current->name);
+	  egg_snprintf(s, sizeof s, "%s%s", helpdir, current->name);
 	else
-	  simple_sprintf(s, "%sset/%s", helpdir, current->name);
+	  egg_snprintf(s, sizeof s, "%sset/%s", helpdir, current->name);
 	if ((f = fopen(s, "r")))
 	  display_tellhelp(idx, item->name, f, flags);
       }
@@ -1299,9 +1269,9 @@
       if (!strcmp(match, item->name) && item->type) {
 
 	if (item->type == 1)
-	  simple_sprintf(s, "%s%s", helpdir, current->name);
+	  egg_snprintf(s, sizeof s, "%s%s", helpdir, current->name);
 	else
-	  simple_sprintf(s, "%sset/%s", helpdir, current->name);
+	  egg_snprintf(s, sizeof s, "%sset/%s", helpdir, current->name);
 	if ((f = fopen(s, "r")))
 	  display_tellhelp(idx, item->name, f, flags);
       }
@@ -1319,8 +1289,7 @@
   get_user_flagrec(dcc[idx].user, &fr, dcc[idx].u.chat->con_chan);
   help_subst(NULL, NULL, 0,
 	     (dcc[idx].status & STAT_TELNET) ? 0 : HELP_IRC, NULL);
-  strncpy(s, text, 1023);
-  s[1023] = 0;
+  strncpyz(s, text, sizeof s);
   if (s[strlen(s) - 1] == '\n')
     s[strlen(s) - 1] = 0;
   if (!s[0])
Index: eggdrop1.6/src/misc_file.c
diff -u eggdrop1.6/src/misc_file.c:1.2 eggdrop1.6/src/misc_file.c:1.3
--- eggdrop1.6/src/misc_file.c:1.2	Sat May 13 15:20:29 2000
+++ eggdrop1.6/src/misc_file.c	Sun Dec 10 09:10:27 2000
@@ -2,7 +2,7 @@
  * misc.c -- handles:
  *   copyfile() movefile()
  * 
- * $Id: misc_file.c,v 1.2 2000/05/13 20:20:29 fabian Exp $
+ * $Id: misc_file.c,v 1.3 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -81,7 +81,7 @@
   
 #ifdef HAVE_RENAME
   /* Try to use rename first */
-  if (rename(oldpath, newpath) == 0)
+  if (!rename(oldpath, newpath))
     return 0;
 #endif /* HAVE_RENAME */
 
@@ -89,7 +89,7 @@
    * deleting the file.
    */
   ret = copyfile(oldpath, newpath);
-  if (ret == 0)
+  if (!ret)
     unlink(oldpath);
   return ret;
 }
Index: eggdrop1.6/src/modules.c
diff -u eggdrop1.6/src/modules.c:1.42 eggdrop1.6/src/modules.c:1.43
--- eggdrop1.6/src/modules.c:1.42	Fri Oct 27 14:32:41 2000
+++ eggdrop1.6/src/modules.c	Sun Dec 10 09:10:27 2000
@@ -4,7 +4,7 @@
  * 
  * by Darrin Smith (beldin at light.iinet.net.au)
  * 
- * $Id: modules.c,v 1.42 2000/10/27 19:32:41 fabian Exp $
+ * $Id: modules.c,v 1.43 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -532,7 +532,6 @@
 {
   int i;
 
-  Context;
   module_list = nmalloc(sizeof(module_entry));
   module_list->name = nmalloc(8);
   strcpy(module_list->name, "eggdrop");
@@ -558,7 +557,6 @@
 #endif
   Function *f;
 
-  Context;
 #ifdef STATIC
   for (s = static_modules; s; s = s->next)
     c += sizeof(struct static_list) + strlen(s->name) + 1;
@@ -592,7 +590,6 @@
 {
   module_entry *p = module_list;
 
-  Context;
   while (p) {
     if (p->name && !egg_strcasecmp(name, p->name)) {
       p->major = major;
@@ -625,11 +622,9 @@
   struct static_list *sl;
 #endif
 
-  Context;
   if (module_find(name, 0, 0) != NULL)
     return MOD_ALREADYLOAD;
 #ifndef STATIC
-  Context;
   if (moddir[0] != '/') {
     if (getcwd(workbuf, 1024) == NULL)
       return MOD_BADCWD;
@@ -638,7 +633,6 @@
     sprintf(workbuf, "%s%s." EGG_MOD_EXT, moddir, name);
 #  ifdef HPUX_HACKS
   hand = shl_load(workbuf, BIND_IMMEDIATE, 0L);
-  Context;
   if (!hand)
     return "Can't load module.";
 #  else
@@ -649,7 +643,6 @@
     return "Can't load module.";
 #      endif
 #    else
-  Context;
   hand = dlopen(workbuf, DLFLAGS);
   if (!hand)
     return dlerror();
@@ -658,7 +651,6 @@
 
   sprintf(workbuf, "%s_start", name);
 #  ifdef HPUX_HACKS
-  Context;
   if (shl_findsym(&hand, workbuf, (short) TYPE_PROCEDURE, (void *) &f))
     f = NULL;
 #  else
@@ -694,7 +686,6 @@
   }
 #  else
   for (sl = static_modules; sl && egg_strcasecmp(sl->name, name); sl = sl->next);
-  Context;
   if (!sl)
     return "Unkown module.";
   f = (Function) sl->func;
@@ -704,7 +695,6 @@
     return "Malloc error";
   p->name = nmalloc(strlen(name) + 1);
   strcpy(p->name, name);
-  Context;
   p->major = 0;
   p->minor = 0;
 #ifndef STATIC
@@ -714,7 +704,6 @@
   p->next = module_list;
   module_list = p;
   e = (((char *(*)()) f) (global_table));
-  Context;
   if (e) {
     module_list = module_list->next;
     nfree(p->name);
@@ -726,7 +715,6 @@
     putlog(LOG_MISC, "*", MOD_LOADED_WITH_LANG, name);
   else
     putlog(LOG_MISC, "*", MOD_LOADED, name);
-  Context;
   return NULL;
 }
 
@@ -736,7 +724,6 @@
   char *e;
   Function *f;
 
-  Context;
   while (p) {
     if ((p->name != NULL) && (!strcmp(name, p->name))) {
       dependancy *d = dependancy_list;
@@ -787,9 +774,8 @@
   module_entry *p = module_list;
 
   while (p) {
-    if (p->name && !egg_strcasecmp(name, p->name) &&
-	((major == p->major) || (major == 0)) &&
-	(minor <= p->minor))
+    if (p->name && (major == p->major || !major) &&
+	minor <= p->minor && !egg_strcasecmp(name, p->name))
       return p;
     p = p->next;
   }
@@ -824,7 +810,6 @@
   module_entry *o = module_find(name1, 0, 0);
   dependancy *d;
 
-  Context;
   if (!p) {
     if (module_load(name2))
       return 0;
@@ -840,7 +825,6 @@
   d->major = major;
   d->minor = minor;
   dependancy_list = d;
-  Context;
   return p->funcs ? p->funcs : (Function *) 1;
 }
 
@@ -850,7 +834,6 @@
   module_entry *p = module_find(name1, 0, 0);
   dependancy *d = dependancy_list, *o = NULL;
 
-  Context;
   if (p == NULL)
     return 0;
   while (d != NULL) {
@@ -871,7 +854,6 @@
       d = d->next;
     }
   }
-  Context;
   return ok;
 }
 
@@ -881,7 +863,7 @@
   char x[100], *p;
 
   p = strrchr(filename, '/');
-  sprintf(x, "%s:%s", modname, p ? p + 1 : filename);
+  egg_snprintf(x, sizeof x, "%s:%s", modname, p ? p + 1 : filename);
   x[19] = 0;
   return n_malloc(size, x, line);
 #else
@@ -896,7 +878,7 @@
   char x[100], *p;
 
   p = strrchr(filename, '/');
-  sprintf(x, "%s:%s", modname, p ? p + 1 : filename);
+  egg_snprintf(x, sizeof x, "%s:%s", modname, p ? p + 1 : filename);
   x[19] = 0;
   return n_realloc(ptr, size, x, line);
 #else
@@ -909,7 +891,7 @@
   char x[100], *p;
 
   p = strrchr(filename, '/');
-  sprintf(x, "%s:%s", modname, p ? p + 1 : filename);
+  egg_snprintf(x, sizeof x, "%s:%s", modname, p ? p + 1 : filename);
   x[19] = 0;
   n_free(ptr, x, line);
 }
@@ -918,7 +900,6 @@
  */
 void add_hook(int hook_num, Function func)
 {
-  Context;
   if (hook_num < REAL_HOOKS) {
     struct hook_entry *p;
 
@@ -980,7 +961,6 @@
 
 void del_hook(int hook_num, Function func)
 {
-  Context;
   if (hook_num < REAL_HOOKS) {
     struct hook_entry *p = hook_list[hook_num], *o = NULL;
 
@@ -1041,7 +1021,6 @@
   if (hooknum >= REAL_HOOKS)
     return 0;
   p = hook_list[hooknum];
-  Context;
   for (p = hook_list[hooknum]; p && !f; p = pn) {
     pn = p->next;
     f = p->func(a, b, c, d);
Index: eggdrop1.6/src/net.c
diff -u eggdrop1.6/src/net.c:1.26 eggdrop1.6/src/net.c:1.27
--- eggdrop1.6/src/net.c:1.26	Mon Oct 30 14:49:46 2000
+++ eggdrop1.6/src/net.c	Sun Dec 10 09:10:27 2000
@@ -2,7 +2,7 @@
  * net.c -- handles:
  *   all raw network i/o
  * 
- * $Id: net.c,v 1.26 2000/10/30 20:49:46 fabian Exp $
+ * $Id: net.c,v 1.27 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * This is hereby released into the public domain.
@@ -86,7 +86,6 @@
 {
   int i, tot = 0;
 
-  Context;
   for (i = 0; i < MAXSOCKS; i++) {
     if (!(socklist[i].flags & SOCK_UNUSED)) {
       if (socklist[i].inbuf != NULL)
@@ -209,7 +208,6 @@
 {
   int i;
 
-  Context;
   for (i = 0; i < MAXSOCKS; i++)
     if (socklist[i].sock == sock) {
       if (operation == EGG_OPTION_SET)
@@ -516,8 +514,7 @@
     sprintf(s, "%u.%u.%u.%u", p[0], p[1], p[2], p[3]);
     return s;
   }
-  strncpy(s, hp->h_name, UHOSTLEN - 1);
-  s[UHOSTLEN - 1] = 0;
+  strncpyz(s, hp->h_name, sizeof s);
   return s;
 }
 
@@ -553,8 +550,7 @@
      *
      * strncpy(caller, hostnamefromip(*ip), 120);
      */
-    strncpy(caller, iptostr(*ip), 120);
-    caller[120] = 0;
+    strncpyz(caller, iptostr(*ip), 121);
     *ip = ntohl(*ip);
   }
   if (port != NULL)
@@ -736,7 +732,6 @@
   char xx[514], *p, *px;
   int ret, i, data = 0;
 
-  Context;
   for (i = 0; i < MAXSOCKS; i++) {
     /* Check for stored-up data waiting to be processed */
     if (!(socklist[i].flags & SOCK_UNUSED) &&
@@ -788,14 +783,12 @@
     /* Also check any sockets that might have EOF'd during write */
     if (!(socklist[i].flags & SOCK_UNUSED)
 	&& (socklist[i].flags & SOCK_EOFD)) {
-      Context;
       s[0] = 0;
       *len = socklist[i].sock;
       return -1;
     }
   }
   /* No pent-up data of any worth -- down to business */
-  Context;
   *len = 0;
   ret = sockread(xx, len);
   if (ret < 0) {
@@ -834,7 +827,6 @@
     socklist[ret].inbuf[socklist[ret].inbuflen] = 0;
     return -4;	/* Ignore this one. */
   }
-  Context;
   /* Might be necessary to prepend stored-up data! */
   if (socklist[ret].inbuf != NULL) {
     p = socklist[ret].inbuf;
@@ -858,7 +850,6 @@
       /* (leave the rest to be post-pended later) */
     }
   }
-  Context;
   /* Look for EOL marker; if it's there, i have something to show */
   p = strchr(xx, '\n');
   if (p == NULL)
@@ -882,7 +873,6 @@
       data = 1;
     }
   }
-  Context;
   *len = strlen(s);
   /* Anything left that needs to be saved? */
   if (!xx[0]) {
@@ -891,10 +881,8 @@
     else
       return -3;
   }
-  Context;
   /* Prepend old data back */
   if (socklist[ret].inbuf != NULL) {
-    Context;
     p = socklist[ret].inbuf;
     socklist[ret].inbuflen = strlen(p) + strlen(xx);
     socklist[ret].inbuf = (char *) nmalloc(socklist[ret].inbuflen + 1);
@@ -902,17 +890,13 @@
     strcat(socklist[ret].inbuf, p);
     nfree(p);
   } else {
-    Context;
     socklist[ret].inbuflen = strlen(xx);
     socklist[ret].inbuf = (char *) nmalloc(socklist[ret].inbuflen + 1);
     strcpy(socklist[ret].inbuf, xx);
   }
-  Context;
   if (data) {
-    Context;
     return socklist[ret].sock;
   } else {
-    Context;
     return -3;
   }
 }
@@ -1109,8 +1093,6 @@
   /* It is disabled HERE so we only have to check in *one* spot! */
   if (!dcc_sanitycheck)
     return 1;
-  Context;			/* This should be pretty solid, but
-				   something _might_ break. */
   if (prt < 1) {
     putlog(LOG_MISC, "*", "ALERT: (%s!%s) specified an impossible port of %u!",
 	   nick, from, prt);
@@ -1137,16 +1119,13 @@
   /* It is disabled HERE so we only have to check in *one* spot! */
   if (!dcc_sanitycheck)
     return 1;
-  Context;			/* This should be pretty solid, but
-				   something _might_ break. */
   sprintf(badaddress, "%u.%u.%u.%u", (ip >> 24) & 0xff, (ip >> 16) & 0xff,
 	  (ip >> 8) & 0xff, ip & 0xff);
   /* These should pad like crazy with zeros, since 120 bytes or so is
    * where the routines providing our data currently lose interest. I'm
    * using the n-variant in case someone changes that...
    */
-  strncpy(hostn, extracthostname(from), 255);
-  hostn[255] = 0;
+  strncpyz(hostn, extracthostname(from), sizeof hostn);
   if (!egg_strcasecmp(hostn, dnsname)) {
     putlog(LOG_DEBUG, "*", "DNS information for submitted IP checks out.");
     return 1;
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.399 eggdrop1.6/src/patch.h:1.400
--- eggdrop1.6/src/patch.h:1.399	Thu Dec  7 21:07:38 2000
+++ eggdrop1.6/src/patch.h	Sun Dec 10 09:10:27 2000
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  * 
- * $Id: patch.h,v 1.399 2000/12/08 03:07:38 guppy Exp $
+ * $Id: patch.h,v 1.400 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("976243381");		/* current unixtime */
+patch("976459694");		/* current unixtime */
 /*
  *
  *
  */
-patch("tclfiles");
+patch("core_cleanups");
 /*
  *
  *
Index: eggdrop1.6/src/rfc1459.c
diff -u eggdrop1.6/src/rfc1459.c:1.3 eggdrop1.6/src/rfc1459.c:1.4
--- eggdrop1.6/src/rfc1459.c:1.3	Tue Dec 21 11:35:10 1999
+++ eggdrop1.6/src/rfc1459.c	Sun Dec 10 09:10:27 2000
@@ -1,7 +1,7 @@
 /* 
  * rfc1459.c
  * 
- * $Id: rfc1459.c,v 1.3 1999/12/21 17:35:10 fabian Exp $
+ * $Id: rfc1459.c,v 1.4 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * This code was more or less cloned from the ircd-hybrid 5.3 source.
@@ -30,7 +30,7 @@
   register unsigned char *str2 = (unsigned char *) s2;
   register int res;
 
-  while ((res = rfc_toupper(*str1) - rfc_toupper(*str2)) == 0) {
+  while (!(res = rfc_toupper(*str1) - rfc_toupper(*str2))) {
     if (*str1 == '\0')
       return 0;
     str1++;
@@ -45,11 +45,11 @@
   register unsigned char *s2 = (unsigned char *) str2;
   register int res;
 
-  while ((res = rfc_toupper(*s1) - rfc_toupper(*s2)) == 0) {
+  while (!(res = rfc_toupper(*s1) - rfc_toupper(*s2))) {
     s1++;
     s2++;
     n--;
-    if (n == 0 || (*s1 == '\0' && *s2 == '\0'))
+    if (!n || (*s1 == '\0' && *s2 == '\0'))
       return 0;
   }
   return (res);
Index: eggdrop1.6/src/tcl.c
diff -u eggdrop1.6/src/tcl.c:1.24 eggdrop1.6/src/tcl.c:1.25
--- eggdrop1.6/src/tcl.c:1.24	Fri Aug 11 17:40:26 2000
+++ eggdrop1.6/src/tcl.c	Sun Dec 10 09:10:27 2000
@@ -4,7 +4,7 @@
  *   Tcl initialization
  *   getting and setting Tcl/eggdrop variables
  * 
- * $Id: tcl.c,v 1.24 2000/08/11 22:40:26 fabian Exp $
+ * $Id: tcl.c,v 1.25 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -94,7 +94,6 @@
 {
   int i, tot = 0;
 
-  Context;
   for (i = 0; i < max_logs; i++)
     if (logs[i].filename != NULL) {
       tot += strlen(logs[i].filename) + 1;
@@ -219,7 +218,7 @@
   coupletinfo *cp = (coupletinfo *) cdata;
 
   if (flags & (TCL_TRACE_READS | TCL_TRACE_UNSETS)) {
-    sprintf(s1, "%d:%d", *(cp->left), *(cp->right));
+    egg_snprintf(s1, sizeof s1, "%d:%d", *(cp->left), *(cp->right));
     Tcl_SetVar2(interp, name1, name2, s1, TCL_GLOBAL_ONLY);
     if (flags & TCL_TRACE_UNSETS)
       Tcl_TraceVar(interp, name1,
@@ -259,9 +258,9 @@
       fr.udef_global = default_uflags;
       build_flags(s1, &fr, 0);
     } else if ((int *) ii->var == &userfile_perm) {
-      sprintf(s1, "0%o", userfile_perm);
+      egg_snprintf(s1, sizeof s1, "0%o", userfile_perm);
     } else
-      sprintf(s1, "%d", *(int *) ii->var);
+      egg_snprintf(s1, sizeof s1, "%d", *(int *) ii->var);
     Tcl_SetVar2(interp, name1, name2, s1, TCL_GLOBAL_ONLY);
     if (flags & TCL_TRACE_UNSETS)
       Tcl_TraceVar(interp, name1,
@@ -321,9 +320,9 @@
 
   if (flags & (TCL_TRACE_READS | TCL_TRACE_UNSETS)) {
     if ((st->str == firewall) && (firewall[0])) {
-      char s1[161];
+      char s1[127];
 
-      sprintf(s1, "%s:%d", firewall, firewallport);
+      egg_snprintf(s1, sizeof s1, "%s:%d", firewall, firewallport);
       Tcl_SetVar2(interp, name1, name2, s1, TCL_GLOBAL_ONLY);
     } else
       Tcl_SetVar2(interp, name1, name2, st->str, TCL_GLOBAL_ONLY);
@@ -480,7 +479,6 @@
 
 void kill_tcl()
 {
-  Context;
   rem_tcl_coups(def_tcl_coups);
   rem_tcl_strings(def_tcl_strings);
   rem_tcl_ints(def_tcl_ints);
@@ -500,7 +498,6 @@
   char pver[1024] = "";
 #endif
 
-  Context;
 #ifndef HAVE_PRE7_5_TCL
   /* This is used for 'info nameofexecutable'.
    * The filename in argv[0] must exist in a directory listed in
@@ -554,7 +551,6 @@
     if (f != NULL)
       fprintf(f, "eval: %s\n", script);
   }
-  Context;
   code = Tcl_Eval(interp, script);
   if (debug_tcl && (f != NULL)) {
     fprintf(f, "done eval, result=%d\n", code);
Index: eggdrop1.6/src/tcldcc.c
diff -u eggdrop1.6/src/tcldcc.c:1.23 eggdrop1.6/src/tcldcc.c:1.24
--- eggdrop1.6/src/tcldcc.c:1.23	Thu Dec  7 21:07:38 2000
+++ eggdrop1.6/src/tcldcc.c	Sun Dec 10 09:10:27 2000
@@ -2,7 +2,7 @@
  * tcldcc.c -- handles:
  *   Tcl stubs for the dcc commands
  * 
- * $Id: tcldcc.c,v 1.23 2000/12/08 03:07:38 guppy Exp $
+ * $Id: tcldcc.c,v 1.24 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -143,7 +143,7 @@
 static int tcl_hand2idx STDVAR
 {
   int i;
-  char s[10];
+  char s[11];
 
   BADARGS(2, 2, " nickname");
   for (i = 0; i < dcc_total; i++)
@@ -228,6 +228,7 @@
   /* Console autosave. */
   if ((me = module_find("console", 1, 1))) {
     Function *func = me->funcs;
+
     (func[CONSOLE_DOSTORE]) (idx);
   }
   return TCL_OK;
@@ -304,6 +305,7 @@
   /* Console autosave. */
   if (argc > 2 && (me = module_find("console", 1, 1))) {
     Function *func = me->funcs;
+
     (func[CONSOLE_DOSTORE]) (i);
   }
   return TCL_OK;
@@ -345,6 +347,7 @@
   /* Console autosave. */
   if (argc > 2 && (me = module_find("console", 1, 1))) {
     Function *func = me->funcs;
+
     (func[CONSOLE_DOSTORE]) (i);
   }
   return TCL_OK;
@@ -374,6 +377,7 @@
   /* Console autosave. */
   if (argc > 2 && (me = module_find("console", 1, 1))) {
     Function *func = me->funcs;
+
     (func[CONSOLE_DOSTORE]) (i);
   }
   return TCL_OK;
@@ -409,6 +413,7 @@
   /* Console autosave. */
   if ((argc > 2) && (me = module_find("console", 1, 1))) {
     Function *func = me->funcs;
+
     (func[CONSOLE_DOSTORE]) (i);
   }
   return TCL_OK;
@@ -443,8 +448,7 @@
   /* Do not buffer data anymore. All received and stored data is passed
      over to the dcc functions from now on.  */
   sockoptions(dcc[idx].sock, EGG_OPTION_UNSET, SOCK_BUFFER);
-  strncpy(dcc[idx].u.script->command, argv[2], 120);
-  dcc[idx].u.script->command[120] = 0;
+  strncpyz(dcc[idx].u.script->command, argv[2], 120);
   return TCL_OK;
 }
 
@@ -583,11 +587,10 @@
 {
   int i;
   char idxstr[10];
-  char timestamp[15];	/* When will unixtime ever be 14 numbers long */
+  char timestamp[10];
   char *list[6], *p;
   char other[160];
 
-  Context;
   BADARGS(1, 2, " ?type?");
   for (i = 0; i < dcc_total; i++) {
     if (argc == 1 ||
@@ -882,7 +885,7 @@
     /* Try to grab port */
     j = port + 20;
     i = (-1);
-    while ((port < j) && (i < 0)) {
+    while (port < j && i < 0) {
       i = open_listen(&port);
       if (i < 0)
 	port++;
@@ -898,7 +901,7 @@
     dcc[idx].timeval = now;
   }
   /* script? */
-  if (!egg_strcasecmp(argv[2], "script")) {
+  if (!strcmp(argv[2], "script")) {
     strcpy(dcc[idx].nick, "(script)");
     if (argc < 4) {
       Tcl_AppendResult(irp, "must give proc name for script listen", NULL);
@@ -907,7 +910,7 @@
       return TCL_ERROR;
     }
     if (argc == 5) {
-      if (egg_strcasecmp(argv[4], "pub")) {
+      if (strcmp(argv[4], "pub")) {
 	Tcl_AppendResult(irp, "unknown flag: ", argv[4], ". allowed flags: pub",
 		         NULL);
 	killsock(dcc[idx].sock);
@@ -922,11 +925,11 @@
     return TCL_OK;
   }
   /* bots/users/all */
-  if (!egg_strcasecmp(argv[2], "bots"))
+  if (!strcmp(argv[2], "bots"))
     strcpy(dcc[idx].nick, "(bots)");
-  else if (!egg_strcasecmp(argv[2], "users"))
+  else if (!strcmp(argv[2], "users"))
     strcpy(dcc[idx].nick, "(users)");
-  else if (!egg_strcasecmp(argv[2], "all"))
+  else if (!strcmp(argv[2], "all"))
     strcpy(dcc[idx].nick, "(telnet)");
   if (!dcc[idx].nick[0]) {
     Tcl_AppendResult(irp, "illegal listen type: must be one of ",
Index: eggdrop1.6/src/tclhash.c
diff -u eggdrop1.6/src/tclhash.c:1.19 eggdrop1.6/src/tclhash.c:1.20
--- eggdrop1.6/src/tclhash.c:1.19	Mon Oct 30 14:50:41 2000
+++ eggdrop1.6/src/tclhash.c	Sun Dec 10 09:10:27 2000
@@ -7,7 +7,7 @@
  *   (non-Tcl) procedure lookups for msg/dcc/file commands
  *   (Tcl) binding internal procedures to msg/dcc/file commands
  * 
- * $Id: tclhash.c,v 1.19 2000/10/30 20:50:41 fabian Exp $
+ * $Id: tclhash.c,v 1.20 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -230,9 +230,9 @@
   H_bcst = add_bind_table("bcst", HT_STACKABLE, builtin_chat);
   H_away = add_bind_table("away", HT_STACKABLE, builtin_chat);
   H_act = add_bind_table("act", HT_STACKABLE, builtin_chat);
-  Context;
   H_event = add_bind_table("evnt", HT_STACKABLE, builtin_char);
   add_builtins(H_dcc, C_dcc);
+  Context;
 }
 
 void kill_bind(void)
@@ -263,7 +263,7 @@
     if (tl->flags & HT_DELETED)
       continue;
     v = egg_strcasecmp(tl->name, nme);
-    if (v == 0)
+    if (!v)
       return tl;	/* Duplicate, just return old value.	*/
     if (v > 0)
       break;		/* New. Insert at start of list.	*/
@@ -311,7 +311,7 @@
     if (tl->flags & HT_DELETED)
       continue;
     v = egg_strcasecmp(tl->name, nme);
-    if (v == 0)
+    if (!v)
       return tl;
     if (v > 0)
       return NULL;
@@ -373,12 +373,6 @@
   tcl_cmd_t		*tc;
   tcl_bind_mask_t	*tm, *tm_last;
 
-  if (proc[0] == '#') {
-    putlog(LOG_MISC, "*", "Note: binding to '#' is obsolete.");
-    return 0;
-  }
-  Context;
-
   /* Search for matching bind in bind list. */
   for (tm = tl->first, tm_last = NULL; tm; tm_last = tm, tm = tm->next) {
     if (tm->flags & TBM_DELETED)
@@ -432,7 +426,6 @@
   tc->next = tm->first;
   tm->first = tc;
 
-  Context;
   return 1;
 }
 
@@ -637,7 +630,6 @@
   int idx;
   Function F = (Function) cd;
 
-  Context;
   BADARGS(4, 4, " hand idx param");
   idx = findidx(atoi(argv[2]));
   if (idx < 0) {
@@ -654,12 +646,9 @@
   debug4("tcl: builtin dcc call: %s %s %s %s", argv[0], argv[1], argv[2],
 	 (!strcmp(argv[0] + 5, "newpass") ||
 	  !strcmp(argv[0] + 5, "chpass")) ? "[something]" : argv[3]);
-  Context;
   (F) (dcc[idx].user, idx, argv[3]);
-  Context;
   Tcl_ResetResult(irp);
   Tcl_AppendResult(irp, "0", NULL);
-  Context;
   return TCL_OK;
 }
 
@@ -689,7 +678,6 @@
     ContextNote(buf);
     nfree(buf);
   }
-  Context;
   x = Tcl_VarEval(interp, proc, param, NULL);
   Context;
   if (x == TCL_ERROR) {
@@ -721,7 +709,6 @@
   tcl_cmd_t		*tc, *htc = NULL;
   int			 finish = 0, atrok, x, ok;
 
-  Context;
   for (tm = tl->first; tm && !finish; tm_last = tm, tm = tm->next) {
     if (tm->flags & TBM_DELETED)
       continue;
@@ -744,7 +731,7 @@
     default:
       ok = 0;
     }
-    if (ok == 0)
+    if (!ok)
       continue;	/* This bind does not match. */
 
     if (match_type & BIND_STACKABLE) {
@@ -820,7 +807,7 @@
     }
   }
 
-  if (cnt == 0)
+  if (!cnt)
     return BIND_NOMATCH;
   if ((match_type & 0x03) == MATCH_MASK ||
       (match_type & 0x03) == MATCH_CASE)
@@ -851,18 +838,15 @@
 {
   struct flag_record	fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
   int			x;
-  char			s[20];
+  char			s[11];
 
-  Context;
   get_user_flagrec(dcc[idx].user, &fr, dcc[idx].u.chat->con_chan);
-  sprintf(s, "%ld", dcc[idx].sock);
+  egg_snprintf(s, sizeof s, "%ld", dcc[idx].sock);
   Tcl_SetVar(interp, "_dcc1", (char *) dcc[idx].nick, 0);
   Tcl_SetVar(interp, "_dcc2", (char *) s, 0);
   Tcl_SetVar(interp, "_dcc3", (char *) args, 0);
-  Context;
   x = check_tcl_bind(H_dcc, cmd, &fr, " $_dcc1 $_dcc2 $_dcc3",
 		     MATCH_PARTIAL | BIND_USE_ATTR | BIND_HAS_BUILTINS);
-  Context;
   if (x == BIND_AMBIGUOUS) {
     dprintf(idx, MISC_AMBIGUOUS);
     return 0;
@@ -880,7 +864,6 @@
 
 void check_tcl_bot(const char *nick, const char *code, const char *param)
 {
-  Context;
   Tcl_SetVar(interp, "_bot1", (char *) nick, 0);
   Tcl_SetVar(interp, "_bot2", (char *) code, 0);
   Tcl_SetVar(interp, "_bot3", (char *) param, 0);
@@ -890,92 +873,73 @@
 void check_tcl_chonof(char *hand, int sock, tcl_bind_list_t *tl)
 {
   struct flag_record	 fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
-  char			 s[20];
+  char			 s[11];
   struct userrec	*u;
 
-  Context;
   u = get_user_by_handle(userlist, hand);
   touch_laston(u, "partyline", now);
   get_user_flagrec(u, &fr, NULL);
   Tcl_SetVar(interp, "_chonof1", (char *) hand, 0);
-  simple_sprintf(s, "%d", sock);
+  egg_snprintf(s, sizeof s, "%d", sock);
   Tcl_SetVar(interp, "_chonof2", (char *) s, 0);
-  Context;
   check_tcl_bind(tl, hand, &fr, " $_chonof1 $_chonof2", MATCH_MASK |
 		 BIND_USE_ATTR | BIND_STACKABLE | BIND_WANTRET);
-  Context;
 }
 
 void check_tcl_chatactbcst(const char *from, int chan, const char *text,
 			   tcl_bind_list_t *tl)
 {
-  char s[20];
+  char s[11];
 
-  Context;
-  simple_sprintf(s, "%d", chan);
+  egg_snprintf(s, sizeof s, "%d", chan);
   Tcl_SetVar(interp, "_cab1", (char *) from, 0);
   Tcl_SetVar(interp, "_cab2", (char *) s, 0);
   Tcl_SetVar(interp, "_cab3", (char *) text, 0);
   check_tcl_bind(tl, text, 0, " $_cab1 $_cab2 $_cab3",
 		 MATCH_MASK | BIND_STACKABLE);
-  Context;
 }
 
 void check_tcl_nkch(const char *ohand, const char *nhand)
 {
-  Context;
   Tcl_SetVar(interp, "_nkch1", (char *) ohand, 0);
   Tcl_SetVar(interp, "_nkch2", (char *) nhand, 0);
   check_tcl_bind(H_nkch, ohand, 0, " $_nkch1 $_nkch2",
 		 MATCH_MASK | BIND_STACKABLE);
-  Context;
 }
 
 void check_tcl_link(const char *bot, const char *via)
 {
-  Context;
   Tcl_SetVar(interp, "_link1", (char *) bot, 0);
   Tcl_SetVar(interp, "_link2", (char *) via, 0);
-  Context;
   check_tcl_bind(H_link, bot, 0, " $_link1 $_link2",
 		 MATCH_MASK | BIND_STACKABLE);
-  Context;
 }
 
 void check_tcl_disc(const char *bot)
 {
-  Context;
   Tcl_SetVar(interp, "_disc1", (char *) bot, 0);
-  Context;
   check_tcl_bind(H_disc, bot, 0, " $_disc1", MATCH_MASK | BIND_STACKABLE);
-  Context;
 }
 
 void check_tcl_loadunld(const char *mod, tcl_bind_list_t *tl)
 {
-  Context;
   Tcl_SetVar(interp, "_lu1", (char *) mod, 0);
-  Context;
   check_tcl_bind(tl, mod, 0, " $_lu1", MATCH_MASK | BIND_STACKABLE);
-  Context;
 }
 
 const char *check_tcl_filt(int idx, const char *text)
 {
-  char			s[20];
+  char			s[11];
   int			x;
   struct flag_record	fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
 
-  Context;
-  sprintf(s, "%ld", dcc[idx].sock);
+  egg_snprintf(s, sizeof s, "%ld", dcc[idx].sock);
   get_user_flagrec(dcc[idx].user, &fr, dcc[idx].u.chat->con_chan);
   Tcl_SetVar(interp, "_filt1", (char *) s, 0);
   Tcl_SetVar(interp, "_filt2", (char *) text, 0);
-  Context;
   x = check_tcl_bind(H_filt, text, &fr, " $_filt1 $_filt2",
 		     MATCH_MASK | BIND_USE_ATTR | BIND_STACKABLE |
 		     BIND_WANTRET | BIND_ALTER_ARGS);
-  Context;
   if (x == BIND_EXECUTED || x == BIND_EXEC_LOG) {
     if (interp->result == NULL || !interp->result[0])
       return "";
@@ -989,7 +953,6 @@
 {
   int	x;
 
-  Context;
   Tcl_SetVar(interp, "_note1", (char *) from, 0);
   Tcl_SetVar(interp, "_note2", (char *) to, 0);
   Tcl_SetVar(interp, "_note3", (char *) text, 0);
@@ -999,15 +962,12 @@
 
 void check_tcl_listen(const char *cmd, int idx)
 {
-  char	s[20];
+  char	s[11];
   int	x;
 
-  Context;
-  simple_sprintf(s, "%d", idx);
+  egg_snprintf(s, sizeof s, "%d", idx);
   Tcl_SetVar(interp, "_n", (char *) s, 0);
-  Context;
   x = Tcl_VarEval(interp, cmd, " $_n", NULL);
-  Context;
   if (x == TCL_ERROR)
     putlog(LOG_MISC, "*", "error on listen: %s", interp->result);
 }
@@ -1016,9 +976,8 @@
 		    const char type, int sock, const char *host)
 {
   struct flag_record	fr = {FR_GLOBAL, 0, 0, 0, 0, 0};
-  char			s[20], t[2], u[20];
+  char			s[11], t[2], u[11];
 
-  Context;
   t[0] = type;
   t[1] = 0;
   switch (type) {
@@ -1034,83 +993,70 @@
   case '%':
     fr.global = USER_BOTMAST;
   }
-  sprintf(s, "%d", chan);
-  sprintf(u, "%d", sock);
+  egg_snprintf(s, sizeof s, "%d", chan);
+  egg_snprintf(u, sizeof u, "%d", sock);
   Tcl_SetVar(interp, "_chjn1", (char *) bot, 0);
   Tcl_SetVar(interp, "_chjn2", (char *) nick, 0);
   Tcl_SetVar(interp, "_chjn3", (char *) s, 0);
   Tcl_SetVar(interp, "_chjn4", (char *) t, 0);
   Tcl_SetVar(interp, "_chjn5", (char *) u, 0);
   Tcl_SetVar(interp, "_chjn6", (char *) host, 0);
-  Context;
   check_tcl_bind(H_chjn, s, &fr,
 		 " $_chjn1 $_chjn2 $_chjn3 $_chjn4 $_chjn5 $_chjn6",
 		 MATCH_MASK | BIND_STACKABLE);
-  Context;
 }
 
 void check_tcl_chpt(const char *bot, const char *hand, int sock, int chan)
 {
-  char	u[20], v[20];
+  char	u[11], v[11];
 
-  Context;
-  simple_sprintf(u, "%d", sock);
-  simple_sprintf(v, "%d", chan);
+  egg_snprintf(u, sizeof u, "%d", sock);
+  egg_snprintf(v, sizeof v, "%d", chan);
   Tcl_SetVar(interp, "_chpt1", (char *) bot, 0);
   Tcl_SetVar(interp, "_chpt2", (char *) hand, 0);
   Tcl_SetVar(interp, "_chpt3", (char *) u, 0);
   Tcl_SetVar(interp, "_chpt4", (char *) v, 0);
-  Context;
   check_tcl_bind(H_chpt, v, 0, " $_chpt1 $_chpt2 $_chpt3 $_chpt4",
 		 MATCH_MASK | BIND_STACKABLE);
-  Context;
 }
 
 void check_tcl_away(const char *bot, int idx, const char *msg)
 {
-  char	u[20];
+  char	u[11];
 
-  Context;
-  simple_sprintf(u, "%d", idx);
+  egg_snprintf(u, sizeof u, "%d", idx);
   Tcl_SetVar(interp, "_away1", (char *) bot, 0);
   Tcl_SetVar(interp, "_away2", (char *) u, 0);
   Tcl_SetVar(interp, "_away3", msg ? (char *) msg : "", 0);
-  Context;
   check_tcl_bind(H_away, bot, 0, " $_away1 $_away2 $_away3",
 		 MATCH_MASK | BIND_STACKABLE);
 }
 
 void check_tcl_time(struct tm *tm)
 {
-  char y[100];
+  char y[18];
 
-  Context;
-  sprintf(y, "%02d", tm->tm_min);
+  egg_snprintf(y, sizeof y, "%02d", tm->tm_min);
   Tcl_SetVar(interp, "_time1", (char *) y, 0);
-  sprintf(y, "%02d", tm->tm_hour);
+  egg_snprintf(y, sizeof y, "%02d", tm->tm_hour);
   Tcl_SetVar(interp, "_time2", (char *) y, 0);
-  sprintf(y, "%02d", tm->tm_mday);
+  egg_snprintf(y, sizeof y, "%02d", tm->tm_mday);
   Tcl_SetVar(interp, "_time3", (char *) y, 0);
-  sprintf(y, "%02d", tm->tm_mon);
+  egg_snprintf(y, sizeof y, "%02d", tm->tm_mon);
   Tcl_SetVar(interp, "_time4", (char *) y, 0);
-  sprintf(y, "%04d", tm->tm_year + 1900);
+  egg_snprintf(y, sizeof y, "%04d", tm->tm_year + 1900);
   Tcl_SetVar(interp, "_time5", (char *) y, 0);
-  sprintf(y, "%02d %02d %02d %02d %04d", tm->tm_min, tm->tm_hour, tm->tm_mday,
-	  tm->tm_mon, tm->tm_year + 1900);
-  Context;
+  egg_snprintf(y, sizeof y, "%02d %02d %02d %02d %04d", tm->tm_min, tm->tm_hour, 
+	       tm->tm_mday, tm->tm_mon, tm->tm_year + 1900);
   check_tcl_bind(H_time, y, 0,
 		 " $_time1 $_time2 $_time3 $_time4 $_time5",
 		 MATCH_MASK | BIND_STACKABLE);
-  Context;
 }
 
 void check_tcl_event(const char *event)
 {
-  Context;
   Tcl_SetVar(interp, "_event1", (char *) event, 0);
-  Context;
   check_tcl_bind(H_event, event, 0, " $_event1", MATCH_EXACT | BIND_STACKABLE);
-  Context;
 }
 
 void tell_binds(int idx, char *par)
@@ -1121,7 +1067,6 @@
   tcl_cmd_t		*tc;
   char			*name, *proc, *s, flg[100];
 
-  Context;
   if (par[0])
     name = newsplit(&par);
   else
@@ -1193,9 +1138,8 @@
   int	k, i;
   char	p[1024], *l;
 
-  Context;
   for (i = 0; cc[i].name; i++) {
-    simple_sprintf(p, "*%s:%s", tl->name,
+    egg_snprintf(p, sizeof p, "*%s:%s", tl->name,
 		   cc[i].funcname ? cc[i].funcname : cc[i].name);
     l = (char *) nmalloc(Tcl_ScanElement(p, &k));
     Tcl_ConvertElement(p, l, k | TCL_DONT_USE_BRACES);
@@ -1212,7 +1156,7 @@
   char	p[1024], *l;
 
   for (i = 0; cc[i].name; i++) {
-    simple_sprintf(p, "*%s:%s", table->name,
+    egg_snprintf(p, sizeof p, "*%s:%s", table->name,
 		   cc[i].funcname ? cc[i].funcname : cc[i].name);
     l = (char *) nmalloc(Tcl_ScanElement(p, &k));
     Tcl_ConvertElement(p, l, k | TCL_DONT_USE_BRACES);
Index: eggdrop1.6/src/tclmisc.c
diff -u eggdrop1.6/src/tclmisc.c:1.16 eggdrop1.6/src/tclmisc.c:1.17
--- eggdrop1.6/src/tclmisc.c:1.16	Thu Dec  7 21:07:38 2000
+++ eggdrop1.6/src/tclmisc.c	Sun Dec 10 09:10:27 2000
@@ -3,7 +3,7 @@
  *   Tcl stubs for file system commands
  *   Tcl stubs for everything else
  * 
- * $Id: tclmisc.c,v 1.16 2000/12/08 03:07:38 guppy Exp $
+ * $Id: tclmisc.c,v 1.17 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -28,13 +28,11 @@
 #include "main.h"
 #include "modules.h"
 #include "tandem.h"
+#include "md5/md5.h"
 #ifdef HAVE_UNAME
 #include <sys/utsname.h>
 #endif
 
-/* Includes for the tcl_md5 function <Olrick> */
-#include "md5/md5.h"
-
 extern p_tcl_bind_list	 bind_table_list;
 extern tcl_timer_t	*timer, *utimer;
 extern struct dcc_t	*dcc;
@@ -90,30 +88,12 @@
   return TCL_OK;
 }
 
-static int tcl_timer STDVAR
-{
-  unsigned long x;
-  char s[41];
-
-  BADARGS(3, 3, " minutes command");
-  if (atoi(argv[1]) < 0) {
-    Tcl_AppendResult(irp, "time value must be positive", NULL);
-    return TCL_ERROR;
-  }
-  if (argv[2][0] != '#') {
-    x = add_timer(&timer, atoi(argv[1]), argv[2], 0L);
-    sprintf(s, "timer%lu", x);
-    Tcl_AppendResult(irp, s, NULL);
-  }
-  return TCL_OK;
-}
-
 static int tcl_binds STDVAR
 {
   tcl_bind_list_t	*tl, *tl_kind;
   tcl_bind_mask_t	*tm;
   tcl_cmd_t		*tc;
-  char			*list[5], *g, flg[100], hits[160];
+  char			*list[5], *g, flg[100], hits[11];
   int			 matching = 0;
 
   BADARGS(1, 2, " ?type/mask?");
@@ -139,7 +119,7 @@
             !wild_match(argv[1], tc->func_name))
           continue;
 	build_flags(flg, &(tc->flags), NULL);
-        sprintf(hits, "%i", (int) tc->hits);
+        egg_snprintf(hits, sizeof hits, "%i", (int) tc->hits);
         list[0] = tl->name;
         list[1] = flg;
         list[2] = tm->mask;
@@ -154,10 +134,28 @@
   return TCL_OK;
 }
 
+static int tcl_timer STDVAR
+{
+  unsigned long x;
+  char s[16];
+ 
+  BADARGS(3, 3, " minutes command");
+  if (atoi(argv[1]) < 0) {
+    Tcl_AppendResult(irp, "time value must be positive", NULL);
+    return TCL_ERROR;
+  }
+  if (argv[2][0] != '#') {
+    x = add_timer(&timer, atoi(argv[1]), argv[2], 0L);
+    egg_snprintf(s, sizeof s, "timer%lu", x);
+    Tcl_AppendResult(irp, s, NULL);
+  }
+  return TCL_OK;
+}
+
 static int tcl_utimer STDVAR
 {
   unsigned long x;
-  char s[41];
+  char s[16];
 
   BADARGS(3, 3, " seconds command");
   if (atoi(argv[1]) < 0) {
@@ -166,7 +164,7 @@
   }
   if (argv[2][0] != '#') {
     x = add_timer(&utimer, atoi(argv[1]), argv[2], 0L);
-    sprintf(s, "timer%lu", x);
+    egg_snprintf(s, sizeof s, "timer%lu", x);
     Tcl_AppendResult(irp, s, NULL);
   }
   return TCL_OK;
@@ -198,57 +196,60 @@
   return TCL_ERROR;
 }
 
+static int tcl_timers STDVAR
+{
+  BADARGS(1, 1, "");
+  list_timers(irp, timer);
+  return TCL_OK;
+}
+
+static int tcl_utimers STDVAR
+{
+  BADARGS(1, 1, "");
+  list_timers(irp, utimer);
+  return TCL_OK;
+}
+
 static int tcl_duration STDVAR
 {
-  char s[256];
-  time_t sec;
+  char s[70];
+  unsigned long sec, tmp;
 
   BADARGS(2, 2, " seconds");
   if (atol(argv[1]) <= 0) {
     Tcl_AppendResult(irp, "0 seconds", NULL);
     return TCL_OK;
   }
-  sec = atoi(argv[1]);
+  sec = atol(argv[1]);
   s[0] = 0;
   if (sec >= 31536000) {
-    sprintf(s, "%d year", (int) (sec / 31536000));
-    if ((int) (sec / 31536000) > 1)
-      strcat(s, "s");
-    strcat(s, " ");
-    sec -= (((int) (sec / 31536000)) * 31536000);
+    tmp = (sec / 31536000);
+    sprintf(s, "%lu year%s ", tmp, (tmp == 1) ? "" : "s");
+    sec -= (tmp * 31536000);
   }
   if (sec >= 604800) {
-    sprintf(&s[strlen(s)], "%d week", (int) (sec / 604800));
-    if ((int) (sec / 604800) > 1)
-      strcat(s, "s");
-    strcat(s, " ");
-    sec -= (((int) (sec / 604800)) * 604800);
+    tmp = (sec / 604800);
+    sprintf(&s[strlen(s)], "%lu week%s ", tmp, (tmp == 1) ? "" : "s");
+    sec -= (tmp * 604800);
   }
   if (sec >= 86400) {
-    sprintf(&s[strlen(s)], "%d day", (int) (sec / 86400));
-    if ((int) (sec / 86400) > 1)
-      strcat(s, "s");
-    strcat(s, " ");
-    sec -= (((int) (sec / 86400)) * 86400);
+    tmp = (sec / 86400);
+    sprintf(&s[strlen(s)], "%lu day%s ", tmp, (tmp == 1) ? "" : "s");
+    sec -= (tmp * 86400);
   }
   if (sec >= 3600) {
-    sprintf(&s[strlen(s)], "%d hour", (int) (sec / 3600));
-    if ((int) (sec / 3600) > 1)
-      strcat(s, "s");
-    strcat(s, " ");
-    sec -= (((int) (sec / 3600)) * 3600);
+    tmp = (sec / 3600);
+    sprintf(&s[strlen(s)], "%lu hour%s ", tmp, (tmp == 1) ? "" : "s");
+    sec -= (tmp * 3600);
   }
   if (sec >= 60) {
-    sprintf(&s[strlen(s)], "%d minute", (int) (sec / 60));
-    if ((int) (sec / 60) > 1)
-      strcat(s, "s");
-    strcat(s, " ");
-    sec -= (((int) (sec / 60)) * 60);
+    tmp = (sec / 60);
+    sprintf(&s[strlen(s)], "%lu minute%s ", tmp, (tmp == 1) ? "" : "s");
+    sec -= (tmp * 60);
   }
   if (sec > 0) {
-    sprintf(&s[strlen(s)], "%d second", (int) (sec / 1));
-    if ((int) (sec / 1) > 1)
-      strcat(s, "s");
+    tmp = (sec);
+    sprintf(&s[strlen(s)], "%lu second%s", tmp, (tmp == 1) ? "" : "s");
   }
   Tcl_AppendResult(irp, s, NULL);
   return TCL_OK;
@@ -264,20 +265,6 @@
   return TCL_OK;
 }
 
-static int tcl_timers STDVAR
-{
-  BADARGS(1, 1, "");
-  list_timers(irp, timer);
-  return TCL_OK;
-}
-
-static int tcl_utimers STDVAR
-{
-  BADARGS(1, 1, "");
-  list_timers(irp, utimer);
-  return TCL_OK;
-}
-
 static int tcl_ctime STDVAR
 {
   time_t tt;
@@ -290,6 +277,26 @@
   return TCL_OK;
 }
 
+static int tcl_strftime STDVAR
+{
+  char buf[512];
+  struct tm *tm1;
+  time_t t;
+  
+  BADARGS(2, 3, " format ?time?");
+  if (argc == 3)
+    t = atol(argv[2]);
+  else
+    t = now;
+    tm1 = localtime(&t);
+  if (egg_strftime(buf, sizeof(buf) - 1, argv[1], tm1)) {
+    Tcl_AppendResult(irp, buf, NULL);
+    return TCL_OK;
+  }
+  Tcl_AppendResult(irp, " error with strftime", NULL);
+  return TCL_ERROR;
+}
+
 static int tcl_myip STDVAR
 {
   char s[16];
@@ -367,17 +374,16 @@
 
 static int tcl_die STDVAR
 {
-  char s[1024];
-  char g[1024];
+  char s[501];
+  char g[501];
 
-  Context;
   BADARGS(1, 2, " ?reason?");
   if (argc == 2) {
-    simple_sprintf(s, "BOT SHUTDOWN (%s)", argv[1]);
-    simple_sprintf(g, "%s", argv[1]);
+    egg_snprintf(s, sizeof s, "BOT SHUTDOWN (%s)", argv[1]);
+    egg_snprintf(g, sizeof g, "%s", argv[1]);
   } else {
-    simple_sprintf(s, "BOT SHUTDOWN (authorized by a canadian)");
-    simple_sprintf(g, "EXIT");
+    egg_snprintf(s, sizeof s, "BOT SHUTDOWN (aboot time -- eh?)");
+    egg_snprintf(g, sizeof g, "EXIT");
   }
   chatout("*** %s\n", s);
   botnet_send_chat(-1, botnetnick, s);
@@ -387,26 +393,6 @@
   return TCL_OK;
 }
 
-static int tcl_strftime STDVAR
-{
-  char buf[512];
-  struct tm *tm1;
-  time_t t;
-
-  BADARGS(2, 3, " format ?time?");
-  if (argc == 3)
-    t = atol(argv[2]);
-  else
-    t = now;
-    tm1 = localtime(&t);
-  if (egg_strftime(buf, sizeof(buf) - 1, argv[1], tm1)) {
-    Tcl_AppendResult(irp, buf, NULL);
-    return TCL_OK;
-  }
-  Tcl_AppendResult(irp, " error with strftime", NULL);
-  return TCL_ERROR;
-}
-
 static int tcl_loadmodule STDVAR
 {
   const char *p;
@@ -451,19 +437,19 @@
   module_entry *current;
   dependancy *dep;
   char *list[100], *list2[2], *p;
-  char s[40], s2[40];
+  char s[24], s2[24];
   int i;
 
   BADARGS(1, 1, "");
   for (current = module_list; current; current = current->next) {
     list[0] = current->name;
-    simple_sprintf(s, "%d.%d", current->major, current->minor);
+    egg_snprintf(s, sizeof s, "%d.%d", current->major, current->minor);
     list[1] = s;
     i = 2;
     for (dep = dependancy_list; dep && (i < 100); dep = dep->next) {
       if (dep->needing == current) {
 	list2[0] = dep->needed->name;
-	simple_sprintf(s2, "%d.%d", dep->major, dep->minor);
+	egg_snprintf(s2, sizeof s2, "%d.%d", dep->major, dep->minor);
 	list2[1] = s2;
 	list[i] = Tcl_Merge(2, list2);
 	i++;
@@ -528,9 +514,10 @@
   {"utimer",		tcl_utimer},
   {"killtimer",		tcl_killtimer},
   {"killutimer",	tcl_killutimer},
-  {"unixtime",		tcl_unixtime},
   {"timers",		tcl_timers},
   {"utimers",		tcl_utimers},
+  {"unixtime",		tcl_unixtime},
+  {"strftime",          tcl_strftime},
   {"ctime",		tcl_ctime},
   {"myip",		tcl_myip},
   {"rand",		tcl_rand},
@@ -540,7 +527,6 @@
   {"backup",		tcl_backup},
   {"exit",		tcl_die},
   {"die",		tcl_die},
-  {"strftime",		tcl_strftime},
   {"unames",		tcl_unames},
   {"unloadmodule",	tcl_unloadmodule},
   {"loadmodule",	tcl_loadmodule},
Index: eggdrop1.6/src/userent.c
diff -u eggdrop1.6/src/userent.c:1.16 eggdrop1.6/src/userent.c:1.17
--- eggdrop1.6/src/userent.c:1.16	Sat Sep  9 06:39:09 2000
+++ eggdrop1.6/src/userent.c	Sun Dec 10 09:10:27 2000
@@ -2,7 +2,7 @@
  * userent.c -- handles:
  *   user-entry handling, new stylem more versatile.
  * 
- * $Id: userent.c,v 1.16 2000/09/09 11:39:09 fabian Exp $
+ * $Id: userent.c,v 1.17 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -77,9 +77,6 @@
 {
   char *tmp;
 
-  Context;
-  Assert(e);
-  Assert(e->name);
   tmp = e->u.list->extra;
   e->u.list->extra = NULL;
   list_type_kill(e->u.list);
@@ -91,8 +88,6 @@
 {
   char *tmp;
 
-  Assert(e);
-  Assert(!e->name);
   tmp = e->u.string;
   e->u.list = user_malloc(sizeof(struct list_type));
   e->u.list->next = NULL;
@@ -102,7 +97,6 @@
 
 int def_kill(struct user_entry *e)
 {
-  Context;
   nfree(e->u.string);
   nfree(e);
   return 1;
@@ -110,7 +104,6 @@
 
 int def_write_userfile(FILE * f, struct userrec *u, struct user_entry *e)
 {
-  Context;
   if (fprintf(f, "--%s %s\n", e->type->name, e->u.string) == EOF)
     return 0;
   return 1;
@@ -125,13 +118,10 @@
 {
   char *string = (char *) buf;
 
-  ContextNote("drummer's bug?");
   if (string && !string[0])
     string = NULL;
   if (!string && !e->u.string)
     return 1;
-  Context;
-  Assert(string != e->u.string);
   if (string) {
     int l = strlen (string);
     char *i;
@@ -142,8 +132,7 @@
     
     e->u.string = user_realloc (e->u.string, l + 1);
     
-    strncpy (e->u.string, string, l);
-    e->u.string[l] = 0;
+    strncpyz (e->u.string, string, l);
     
     for (i = e->u.string; *i; i++)
       /* Allow bold, inverse, underline, color text here... 
@@ -155,13 +144,11 @@
     nfree(e->u.string);
     e->u.string = NULL;
   }
-  Assert(u);
   if (!noshare && !(u->flags & (USER_BOT | USER_UNSHARED))) {
     if (e->type != &USERENTRY_INFO || share_greet)
       shareout(NULL, "c %s %s %s\n", e->type->name, u->handle,
 	       e->u.string ? e->u.string : "");
   }
-  Context;
   return 1;
 }
 
@@ -190,13 +177,11 @@
 
 int def_expmem(struct user_entry *e)
 {
-  Context;
   return strlen(e->u.string) + 1;
 }
 
 void def_display(int idx, struct user_entry *e)
 {
-  Context;
   dprintf(idx, "  %s: %s\n", e->type->name, e->u.string);
 }
 
@@ -208,7 +193,6 @@
 
 static void comment_display(int idx, struct user_entry *e)
 {
-  Context;
   if (dcc[idx].user && (dcc[idx].user->flags & USER_MASTER))
     dprintf(idx, "  COMMENT: %.70s\n", e->u.string);
 }
@@ -311,11 +295,7 @@
   char *par, *arg;
   struct laston_info *li;
 
-  Context;
-  Assert(e);
-  Assert(e->name);
   par = e->u.list->extra;
-  Assert(par);
   arg = newsplit (&par);
   if (!par[0])
     par = "???";
@@ -334,9 +314,6 @@
   struct laston_info *li;
   int l;
 
-  Assert(e);
-  Assert(e->u.extra);
-  Assert(!e->name);
   li = (struct laston_info *) e->u.extra;
   l = sprintf(work, "%lu %s", li->laston, li->lastonplace);
   e->u.list = user_malloc(sizeof(struct list_type));
@@ -354,7 +331,6 @@
 {
   struct laston_info *li = (struct laston_info *) e->u.extra;
 
-  Context;
   if (fprintf(f, "--LASTON %lu %s\n", li->laston,
 	      li->lastonplace ? li->lastonplace : "") == EOF)
     return 0;
@@ -363,7 +339,6 @@
 
 static int laston_kill(struct user_entry *e)
 {
-  Context;
   if (((struct laston_info *) (e->u.extra))->lastonplace)
     nfree(((struct laston_info *) (e->u.extra))->lastonplace);
   nfree(e->u.extra);
@@ -375,14 +350,11 @@
 {
   struct laston_info *li = (struct laston_info *) e->u.extra;
 
-  Context;
   if (li != buf) {
     if (li) {
-      Assert(li->lastonplace);
       nfree(li->lastonplace);
       nfree(li);
     }
-    ContextNote("(sharebug) occurred in laston_set");
 
     li = e->u.extra = buf;
   }
@@ -446,7 +418,6 @@
 
 static int laston_expmem(struct user_entry *e)
 {
-  Context;
   return sizeof(struct laston_info) +
     strlen(((struct laston_info *) (e->u.extra))->lastonplace) + 1;
 }
@@ -490,9 +461,6 @@
   char *p, *q;
   struct bot_addr *bi = user_malloc(sizeof(struct bot_addr));
 
-  Context;
-  Assert(e);
-  Assert(e->name);
   egg_bzero(bi, sizeof(struct bot_addr));
 
   if (!(q = strchr ((p = e->u.list->extra), ':'))) {
@@ -522,8 +490,6 @@
   struct bot_addr *bi;
   int l;
 
-  Assert(e);
-  Assert(!e->name);
   bi = (struct bot_addr *) e->u.extra;
   l = simple_sprintf(work, "%s:%u/%u", bi->address, bi->telnet_port,
               bi->relay_port);
@@ -538,11 +504,9 @@
 
 static int botaddr_kill(struct user_entry *e)
 {
-  Context;
   nfree(((struct bot_addr *) (e->u.extra))->address);
   nfree(e->u.extra);
   nfree(e);
-  Context;
   return 1;
 }
 
@@ -551,7 +515,6 @@
 {
   register struct bot_addr *bi = (struct bot_addr *) e->u.extra;
 
-  Context;
   if (fprintf(f, "--%s %s:%u/%u\n", e->type->name, bi->address,
 	      bi->telnet_port, bi->relay_port) == EOF)
     return 0;
@@ -562,19 +525,15 @@
 {
   register struct bot_addr *bi = (struct bot_addr *) e->u.extra;
 
-  Context;
   if (!bi && !buf)
     return 1;
   if (bi != buf) {
     if (bi) {
-      Assert(bi->address);
       nfree(bi->address);
       nfree(bi);
     }
-    ContextNote("(sharebug) occurred in botaddr_set");
     bi = e->u.extra = buf;
   }
-  Assert(u);
   if (bi && !noshare && !(u->flags & USER_UNSHARED)) {
     shareout(NULL, "c BOTADDR %s %s %d %d\n", u->handle,
              bi->address, bi->telnet_port, bi->relay_port);
@@ -588,7 +547,6 @@
   register struct bot_addr *bi = (struct bot_addr *) e->u.extra;
   char number[20];
 
-  Context;
   sprintf(number, " %d", bi->telnet_port);
   Tcl_AppendResult(interp, bi->address, number, NULL);
   sprintf(number, " %d", bi->relay_port);
@@ -608,7 +566,6 @@
       bi = user_malloc(sizeof(struct bot_addr));
       egg_bzero(bi, sizeof (struct bot_addr));
     } else {
-      Assert(bi->address);
       nfree(bi->address);
     }
     bi->address = user_malloc(strlen(argv[3]) + 1);
@@ -630,7 +587,6 @@
 {
   register struct bot_addr *bi = (struct bot_addr *) e->u.extra;
 
-  Context;
   return strlen(bi->address) + 1 + sizeof(struct bot_addr);
 }
 
@@ -638,7 +594,6 @@
 {
   register struct bot_addr *bi = (struct bot_addr *) e->u.extra;
 
-  Context;
   dprintf(idx, "  ADDRESS: %.70s\n", bi->address);
   dprintf(idx, "     telnet: %d, relay: %d\n", bi->telnet_port, bi->relay_port);
 }
@@ -707,8 +662,6 @@
 {
   struct xtra_key *curr, *old = NULL, *new = buf;
 
-  Context;
-  Assert(new);
   for (curr = e->u.extra; curr; curr = curr->next) {
     if (curr->key && !egg_strcasecmp(curr->key, new->key)) {
       old = curr;
@@ -762,8 +715,7 @@
   if (l > 500)
     l = 500;
   xk->key = user_malloc(l + 1);
-  strncpy(xk->key, argv[3], l);
-  xk->key[l] = 0;
+  strncpyz(xk->key, argv[3], l);
 
   if (argc == 5) {
     int k = strlen(argv[4]);
@@ -771,8 +723,7 @@
     if (k > 500 - l)
       k = 500 - l;
     xk->data = user_malloc(k + 1);
-    strncpy(xk->data, argv[4], k);
-    xk->data[k] = 0;
+    strncpyz(xk->data, argv[4], k);
   }
   xtra_set(u, e, xk);
   return TCL_OK;
@@ -784,9 +735,6 @@
   struct xtra_key *t;
   char *key, *data;
 
-  Context;
-  Assert(e);
-  Assert(e->name);
   head = curr = e->u.list;
   e->u.extra = NULL;
   while (curr) {
@@ -812,9 +760,6 @@
   struct list_type *t;
   struct xtra_key *curr, *next;
 
-  Context;
-  Assert(e);
-  Assert(!e->name);
   curr = e->u.extra;
   e->u.list = NULL;
   while (curr) {
@@ -837,22 +782,18 @@
   struct xtra_key *xk;
   char **list;
 
-  Context;
   code = Tcl_SplitList(interp, whois_fields, &lc, &list);
   if (code == TCL_ERROR)
     return;
   /* Scan thru xtra field, searching for matches */
-  Context;
   for (xk = e->u.extra; xk; xk = xk->next) {
     /* Ok, it's a valid xtra field entry */
-    Context;
     for (j = 0; j < lc; j++) {
       if (!egg_strcasecmp(list[j], xk->key))
 	dprintf(idx, "  %s: %s\n", xk->key, xk->data);
     }
   }
   Tcl_Free((char *) list);
-  Context;
 }
 
 static int xtra_gotshare(struct userrec *u, struct user_entry *e,
@@ -872,8 +813,7 @@
   if (l > 500)
     l = 500;
   xk->key = user_malloc(l + 1);
-  strncpy(xk->key, arg, l);
-  xk->key[l] = 0;
+  strncpyz(xk->key, arg, l);
 
   if (buf[0]) {
     int k = strlen(buf);
@@ -881,8 +821,7 @@
     if (k > 500 - l)
       k = 500 - l;
     xk->data = user_malloc(k + 1);
-    strncpy(xk->data, buf, k);
-    xk->data[k] = 0;
+    strncpyz(xk->data, buf, k);
   }
   xtra_set(u, e, xk);
   return 1;
@@ -919,7 +858,6 @@
 {
   struct xtra_key *x, *y;
 
-  Context;
   for (x = e->u.extra; x; x = y) {
     y = x->next;
     nfree(x->key);
@@ -927,7 +865,6 @@
     nfree(x);
   }
   nfree(e);
-  Context;
   return 1;
 }
 
@@ -1037,11 +974,11 @@
     if (s[0] && !s[9])
       strcat(s, q->extra);
     else if (!s[0])
-      simple_sprintf(s, "         %s", q->extra);
+      sprintf(s, "         %s", q->extra);
     else {
       if (strlen(s) + strlen(q->extra) + 2 > 65) {
 	dprintf(idx, "%s\n", s);
-	simple_sprintf(s, "         %s", q->extra);
+	sprintf(s, "         %s", q->extra);
       } else {
 	strcat(s, ", ");
 	strcat(s, q->extra);
@@ -1054,22 +991,14 @@
 
 static int hosts_set(struct userrec *u, struct user_entry *e, void *buf)
 {
-  Context;
   if (!buf || !egg_strcasecmp(buf, "none")) {
-    ContextNote("SEGV with sharing bug track");
     /* When the bot crashes, it's in this part, not in the 'else' part */
-    ContextNote(e ? "e is valid" : "e is NULL!");
-    Assert(e);			/* e cannot be null -- rtc */
-    ContextNote((e->u.list) ? "(sharebug) e->u.list is valid" : "(sharebug) e->u.list is NULL!");
     list_type_kill(e->u.list);
-    ContextNote("(sharebug[c1]) occurred in hosts_set - added 99/03/26");
     e->u.list = NULL;
-    ContextNote("(sharebug[c2]) occurred in hosts_set - added 99/03/26");
   } else {
     char *host = buf, *p = strchr(host, ',');
     struct list_type **t;
 
-    ContextNote("SEGV with sharing bug track");
     /* Can't have ,'s in hostmasks */
     while (p) {
       *p = '?';
@@ -1097,7 +1026,6 @@
     (*t)->extra = user_malloc(strlen(host) + 1);
     strcpy((*t)->extra, host);
   }
-  ContextNote("please visit http://www.eggheads.org/bugs.html now.");
   return 1;
 }
 
Index: eggdrop1.6/src/userrec.c
diff -u eggdrop1.6/src/userrec.c:1.28 eggdrop1.6/src/userrec.c:1.29
--- eggdrop1.6/src/userrec.c:1.28	Fri Nov 10 13:43:30 2000
+++ eggdrop1.6/src/userrec.c	Sun Dec 10 09:10:27 2000
@@ -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.28 2000/11/10 19:43:30 guppy Exp $
+ * $Id: userrec.c,v 1.29 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -111,7 +111,6 @@
   struct user_entry *ue;
   struct igrec *i;
 
-  Context;
   tot = 0;
   u = userlist;
   while (u != NULL) {
@@ -188,8 +187,7 @@
 
   if (s == NULL)
     return NULL;
-  strncpy(buf, s, 511);
-  buf[511] = 0;
+  strncpyz(buf, s, sizeof buf);
   if (strict_host)
     return buf;
   if ((p = strchr(buf, '!')))
@@ -291,7 +289,6 @@
   struct userrec *u = bu, *v;
   int i;
 
-  Context;
   while (u != NULL) {
     v = u->next;
     freeuser(u);
@@ -322,7 +319,6 @@
     }
   }
   /* Remember to set your userlist to NULL after calling this */
-  Context;
 }
 
 /* Find CLOSEST host match
@@ -545,7 +541,6 @@
   struct userrec *u;
   int ok;
 
-  Context;
   if (userlist == NULL)
     return;			/* No point in saving userfile */
 
@@ -566,14 +561,12 @@
   tt = now;
   strcpy(s1, ctime(&tt));
   fprintf(f, "#4v: %s -- %s -- written %s", ver, botnetnick, s1);
-  Context;
   ok = 1;
   u = userlist;
   while (u != NULL && ok) {
     ok = write_user(u, f, idx);
     u = u->next;
   }
-  Context;
   if (!ok || fflush(f)) {
     putlog(LOG_MISC, "*", "%s (%s)", USERF_ERRWRITE, strerror(ferror(f)));
     fclose(f);
@@ -581,12 +574,9 @@
     return;
   }
   fclose(f);
-  Context;
   call_hook(HOOK_USERFILE);
-  Context;
   movefile(new_userfile, userfile);
   nfree(new_userfile);
-  Context;
 }
 
 int change_handle(struct userrec *u, char *newh)
@@ -597,20 +587,17 @@
   if (!u)
     return 0;
   /* Nothing that will confuse the userfile */
-  if (newh[1] == 0 && strchr(BADHANDCHARS, newh[0]))
+  if (!newh[1] && strchr(BADHANDCHARS, newh[0]))
     return 0;
   check_tcl_nkch(u->handle, newh);
   /* Yes, even send bot nick changes now: */
   if (!noshare && !(u->flags & USER_UNSHARED))
     shareout(NULL, "h %s %s\n", u->handle, newh);
-  strncpy(s, u->handle, HANDLEN);
-  s[HANDLEN] = 0;
-  strncpy(u->handle, newh, HANDLEN);
-  u->handle[HANDLEN] = 0;
+  strncpyz(s, u->handle, sizeof s);
+  strncpyz(u->handle, newh, sizeof u->handle);
   for (i = 0; i < dcc_total; i++)
-    if (!egg_strcasecmp(dcc[i].nick, s) && dcc[i].type != &DCC_BOT) {
-      strncpy(dcc[i].nick, newh, HANDLEN);
-      dcc[i].nick[HANDLEN] = 0;
+    if (dcc[i].type != &DCC_BOT && !egg_strcasecmp(dcc[i].nick, s)) {
+      strncpyz(dcc[i].nick, newh, sizeof dcc[i].nick);
       if (dcc[i].type == &DCC_CHAT && dcc[i].u.chat->channel >= 0) {
 	chanout_but(-1, dcc[i].u.chat->channel,
 		    "*** Handle change: %s -> %s\n", s, newh);
@@ -634,8 +621,7 @@
   u = (struct userrec *) nmalloc(sizeof(struct userrec));
 
   /* u->next=bu; bu=u; */
-  strncpy(u->handle, handle, HANDLEN);
-  u->handle[HANDLEN] = 0;
+  strncpyz(u->handle, handle, sizeof u->handle);
   u->next = NULL;
   u->chanrec = NULL;
   u->entries = NULL;
@@ -777,7 +763,6 @@
   struct user_entry *e = NULL;
   int i = 0;
 
-  Context;
   u = get_user_by_handle(userlist, handle);
   if (!u)
     return 0;
@@ -867,23 +852,19 @@
  */
 struct userrec *get_user_by_nick(char *nick)
 {
-  struct chanset_t *chan = chanset;
+  struct chanset_t *chan;
   memberlist *m;
 
-  Context;
-  while (chan) {
-    m = chan->channel.member;
-    while (m && m->nick[0]) {
+  for (chan = chanset; chan; chan = chan->next) {
+    for (m = chan->channel.member; m && m->nick[0] ;m = m->next) {
       if (!rfc_casecmp(nick, m->nick)) {
   	char word[512];
 
-	sprintf(word, "%s!%s", m->nick, m->userhost);
+	egg_snprintf(word, sizeof word, "%s!%s", m->nick, m->userhost);
 	/* No need to check the return value ourself */
 	return get_user_by_host(word);;
       }
-      m = m->next;
     }
-    chan = chan->next;
   }
   /* Sorry, no matches */
   return NULL;
Index: eggdrop1.6/src/users.c
diff -u eggdrop1.6/src/users.c:1.22 eggdrop1.6/src/users.c:1.23
--- eggdrop1.6/src/users.c:1.22	Tue Dec  5 20:35:18 2000
+++ eggdrop1.6/src/users.c	Sun Dec 10 09:10:27 2000
@@ -10,7 +10,7 @@
  * 
  * dprintf'ized, 9nov1995
  * 
- * $Id: users.c,v 1.22 2000/12/06 02:35:18 guppy Exp $
+ * $Id: users.c,v 1.23 2000/12/10 15:10:27 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -88,8 +88,6 @@
   struct igrec **u;
   struct igrec *t;
 
-  Context;
-
   i = 0;
   if (!strchr(ign, '!') && (j = atoi(ign))) {
     for (u = &global_ign, j--; *u && j; u = &((*u)->next), j--);
@@ -476,7 +474,6 @@
   struct laston_info *li;
   struct flag_record fr = {FR_GLOBAL, 0, 0, 0, 0, 0};
 
-  Context;
   fr.global = u->flags;
   fr.udef_global = u->flags_udef;
   build_flags(s, &fr, NULL);
@@ -494,14 +491,12 @@
     else
       egg_strftime(s1, 6, "%H:%M", localtime(&li->laston));
   }
-  Context;
   spaces[l] = 0;
   dprintf(idx, "%s%s %-5s%5d %-15s %s (%-10.10s)\n", u->handle, spaces,
 	  get_user(&USERENTRY_PASS, u) ? "yes" : "no", n, s, s1,
 	  (li && li->lastonplace) ? li->lastonplace : "nowhere");
   spaces[l] = ' ';
   /* channel flags? */
-  Context;
   ch = u->chanrec;
   while (ch != NULL) {
     fr.match = FR_CHAN | FR_GLOBAL;
@@ -529,7 +524,6 @@
     ch = ch->next;
   }
   /* user-defined extra fields */
-  Context;
   for (ue = u->entries; ue; ue = ue->next)
     if (!ue->name && ue->type->display)
       ue->type->display(idx, ue);
@@ -564,7 +558,6 @@
   struct list_type *q;
   struct flag_record user, pls, mns;
 
-  Context;
   dprintf(idx, "*** %s '%s':\n", MISC_MATCHING, mtch);
   cnt = 0;
   spaces[HANDLEN - 6] = 0;
@@ -671,7 +664,6 @@
   struct flag_record fr;
   struct chanuserrec *cr;
 
-  Context;
   bu = (*ret);
   ignored[0] = 0;
   if (bu == userlist) {
@@ -687,7 +679,6 @@
   if (f == NULL)
     return 0;
   noshare = noxtra = 1;
-  Context;
   /* read opening comment */
   s = buf;
   fgets(s, 180, f);
@@ -778,8 +769,7 @@
 
 		cr->next = u->chanrec;
 		u->chanrec = cr;
-		strncpy(cr->channel, chname, 80);
-		cr->channel[80] = 0;
+		strncpyz(cr->channel, chname, 80);
 		cr->laston = atoi(st);
 		cr->flags = fr.chan;
 		cr->flags_udef = fr.udef_chan;
@@ -875,7 +865,6 @@
 	    struct user_entry *ue;
 	    int ok = 0;
 
-	    Context;
 	    for (ue = u->entries; ue && !ok; ue = ue->next)
 	      if (ue->name && !egg_strcasecmp(code + 2, ue->name)) {
 		struct list_type *list;
@@ -959,14 +948,12 @@
       }
     }
   }
-  Context;
   fclose(f);
   (*ret) = bu;
   if (ignored[0]) {
     putlog(LOG_MISC, "*", "%s %s", USERF_IGNBANS, ignored);
   }
   putlog(LOG_MISC, "*", "Userfile loaded, unpacking...");
-  Context;
   for (u = bu; u; u = u->next) {
     struct user_entry *e;
 
@@ -988,7 +975,6 @@
       }
   }
   noshare = noxtra = 0;
-  Context;
   /* process the user data *now* */
   return 1;
 }
@@ -1004,7 +990,6 @@
   int got_hub = 0, got_alt = 0, got_shared = 0, linked, ready = 0, i,
    bfl;
 
-  Context;
   /* don't start a new cycle if some links are still pending */
   if (!start) {
     for (i = 0; i < dcc_total; i++) {
@@ -1040,7 +1025,7 @@
 	  if ((bfl & BOT_HUB) && (bfl & BOT_SHARE)) {
 	    if (linked)
 	      got_shared = 1;
-	    else if ((cycle == 0) && ready && !autc)
+	    else if (!cycle && ready && !autc)
 	      autc = u;
 	  } else if ((bfl & BOT_HUB) && cycle > 0) {
 	    if (linked)
@@ -1068,7 +1053,7 @@
 	      }
 	    }
 	}
-	if ((cycle == 0) && (bfl & BOT_REJECT) && in_chain(u->handle)) {
+	if (!cycle && (bfl & BOT_REJECT) && in_chain(u->handle)) {
 	  /* get rid of nasty reject bot */
 	  int i;
 
@@ -1094,7 +1079,7 @@
       u = u->next;
     }
     if (!autc) {
-      if ((cycle == 0) && !got_shared) {
+      if (!cycle && !got_shared) {
 	cycle++;
 	u = userlist;
       } else if ((cycle == 1) && !(got_shared || got_hub)) {
@@ -1103,7 +1088,7 @@
       }
     }
   }
-  if (got_shared && (cycle == 0))
+  if (got_shared && !cycle)
     autc = NULL;
   else if ((got_shared || got_hub) && (cycle == 1))
     autc = NULL;
----------------------- End of diff -----------------------



More information about the Changes mailing list