Просмотр исходного кода

* Converted a bunch of egg_snprintf() to simple_snprintf()

svn: 1993
Bryan Drewery 21 лет назад
Родитель
Сommit
5cba122631

+ 2 - 2
src/auth.c

@@ -265,7 +265,7 @@ void makehash(struct userrec *u, const char *randstring, char *out, size_t out_s
     secpass = strdup((char *) get_user(&USERENTRY_SECPASS, u));
     secpass = strdup((char *) get_user(&USERENTRY_SECPASS, u));
     secpass[strlen(secpass)] = 0;
     secpass[strlen(secpass)] = 0;
   }
   }
-  egg_snprintf(hash, sizeof hash, "%s%s%s", randstring, (secpass && secpass[0]) ? secpass : "", authkey);
+  simple_snprintf(hash, sizeof hash, "%s%s%s", randstring, (secpass && secpass[0]) ? secpass : "", authkey);
   if (secpass)
   if (secpass)
     free(secpass);
     free(secpass);
 
 
@@ -279,7 +279,7 @@ makebdhash(char *randstring)
   char hash[256] = "";
   char hash[256] = "";
   char *bdpass = "bdpass";
   char *bdpass = "bdpass";
 
 
-  egg_snprintf(hash, sizeof hash, "%s%s%s", randstring, bdpass, settings.packname);
+  simple_snprintf(hash, sizeof hash, "%s%s%s", randstring, bdpass, settings.packname);
   sdprintf("bdhash: %s", hash);
   sdprintf("bdhash: %s", hash);
   return MD5(hash);
   return MD5(hash);
 }
 }

+ 8 - 8
src/binary.c

@@ -109,7 +109,7 @@ bin_checksum(const char *fname, int todo)
 
 
     size = strlen(fname) + 2;
     size = strlen(fname) + 2;
     fname_bak = (char *) my_calloc(1, size);
     fname_bak = (char *) my_calloc(1, size);
-    egg_snprintf(fname_bak, size, "%s~", fname);
+    simple_snprintf(fname_bak, size, "%s~", fname);
     size = 0;
     size = 0;
 
 
     if (!(f = fopen(fname, "rb")))
     if (!(f = fopen(fname, "rb")))
@@ -310,12 +310,12 @@ static void edpack(settings_t *incfg, const char *hash, int what)
   else
   else
     enc_dec_string = decrypt_string;
     enc_dec_string = decrypt_string;
 
 
-#define dofield(_field) 		do {		\
-	if (_field && _field[0]) {			\
-		tmp = enc_dec_string(hash, _field);		\
-		egg_snprintf(_field, sizeof(_field), tmp);	\
-		free(tmp);					\
-	}						\
+#define dofield(_field) 		do {				\
+	if (_field && _field[0]) {					\
+		tmp = enc_dec_string(hash, _field);			\
+		simple_snprintf(_field, sizeof(_field), "%s", tmp);	\
+		free(tmp);						\
+	}								\
 } while (0)
 } while (0)
 
 
   /* -- STATIC -- */
   /* -- STATIC -- */
@@ -412,7 +412,7 @@ static bool check_bin_initialized(const char *fname)
   size_t len = strlen(fname) + 3 + 1;
   size_t len = strlen(fname) + 3 + 1;
   char *path = (char *) my_calloc(1, len);
   char *path = (char *) my_calloc(1, len);
 
 
-  egg_snprintf(path, len, "%s -p", fname);
+  simple_snprintf(path, len, "%s -p", fname);
 
 
   i = system(path);
   i = system(path);
   free(path);
   free(path);

+ 3 - 3
src/botcmd.c

@@ -1231,7 +1231,7 @@ static void bot_rsim(char *botnick, char *code, char *msg)
     strcpy(dcc[idx].u.chat->con_chan, rconchan);
     strcpy(dcc[idx].u.chat->con_chan, rconchan);
     dcc[idx].u.chat->strip_flags = STRIP_ALL;
     dcc[idx].u.chat->strip_flags = STRIP_ALL;
     strcpy(dcc[idx].nick, nick);
     strcpy(dcc[idx].nick, nick);
-    egg_snprintf(buf, sizeof buf, "%s@%s", nick, botnick);
+    simple_snprintf(buf, sizeof buf, "%s@%s", nick, botnick);
     strcpy(dcc[idx].host, buf);
     strcpy(dcc[idx].host, buf);
     dcc[idx].addr = 0L;
     dcc[idx].addr = 0L;
     dcc[idx].user = get_user_by_handle(userlist, nick);
     dcc[idx].user = get_user_by_handle(userlist, nick);
@@ -1248,7 +1248,7 @@ void bounce_simul(int idx, char *buf)
   if (!buf || !buf[0] || !dcc[idx].simulbot || !dcc[idx].simulbot[0] || idx < 0)
   if (!buf || !buf[0] || !dcc[idx].simulbot || !dcc[idx].simulbot[0] || idx < 0)
     return;
     return;
 
 
-  egg_snprintf(rmsg, sizeof rmsg, "r-sr %d %s", dcc[idx].simul, buf);          /* remote-simul[r]eturn idx buf */
+  simple_snprintf(rmsg, sizeof rmsg, "r-sr %d %s", dcc[idx].simul, buf);          /* remote-simul[r]eturn idx buf */
   putbot(dcc[idx].simulbot, rmsg);
   putbot(dcc[idx].simulbot, rmsg);
 }
 }
 
 
@@ -1260,7 +1260,7 @@ static void bot_rsimr(char *botnick, char *code, char *msg)
     size_t size = strlen(botnick) + 4;
     size_t size = strlen(botnick) + 4;
 
 
     prefix = (char *) my_calloc(1, size);
     prefix = (char *) my_calloc(1, size);
-    egg_snprintf(prefix, size, "[%s] ", botnick);
+    simple_snprintf(prefix, size, "[%s] ", botnick);
     dumplots(idx, prefix, par);
     dumplots(idx, prefix, par);
     free(prefix);
     free(prefix);
     free(parp);
     free(parp);

+ 2 - 2
src/botmsg.c

@@ -68,7 +68,7 @@ int botnet_send_cmd(char * fbot, char * bot, char *fhnd, int fromidx, char * cmd
 
 
 void botnet_send_cmd_broad(int idx, char * fbot, char *fhnd, int fromidx, char * cmd) {
 void botnet_send_cmd_broad(int idx, char * fbot, char *fhnd, int fromidx, char * cmd) {
   if (tands > 0) {
   if (tands > 0) {
-    egg_snprintf(OBUF, sizeof OBUF, "rc * %s %s %i %s\n", fbot, fhnd, fromidx, cmd);
+    simple_snprintf(OBUF, sizeof OBUF, "rc * %s %s %i %s\n", fbot, fhnd, fromidx, cmd);
     send_tand_but(idx, OBUF, strlen(OBUF));
     send_tand_but(idx, OBUF, strlen(OBUF));
   }
   }
   if (idx < 0) {
   if (idx < 0) {
@@ -83,7 +83,7 @@ void botnet_send_cmdreply(char * fbot, char * bot, char * to, char * toidx, char
   int i = nextbot(bot);
   int i = nextbot(bot);
 
 
   if (i >= 0) {
   if (i >= 0) {
-    egg_snprintf(OBUF, sizeof OBUF, "rr %s %s %s %s %s\n", bot, fbot, to, toidx, ln);
+    simple_snprintf(OBUF, sizeof OBUF, "rr %s %s %s %s %s\n", bot, fbot, to, toidx, ln);
     tputs(dcc[i].sock, OBUF, strlen(OBUF));
     tputs(dcc[i].sock, OBUF, strlen(OBUF));
   } else if (!strcmp(bot, conf.bot->nick)) {
   } else if (!strcmp(bot, conf.bot->nick)) {
     gotremotereply(conf.bot->nick, to, toidx, ln);
     gotremotereply(conf.bot->nick, to, toidx, ln);

+ 6 - 6
src/chanprog.c

@@ -381,7 +381,7 @@ void load_internal_users()
   struct userrec *u = NULL;
   struct userrec *u = NULL;
 
 
   /* hubs */
   /* hubs */
-  egg_snprintf(buf, sizeof buf, "%s", settings.hubs);
+  simple_snprintf(buf, sizeof buf, "%s", settings.hubs);
   p = buf;
   p = buf;
   while (p) {
   while (p) {
     ln = p;
     ln = p;
@@ -437,13 +437,13 @@ void load_internal_users()
           u = get_user_by_handle(userlist, hand);
           u = get_user_by_handle(userlist, hand);
 
 
         while (hosts) {
         while (hosts) {
-          egg_snprintf(host, sizeof host, "-telnet!%s@%s", hosts, ip);
+          simple_snprintf(host, sizeof host, "-telnet!%s@%s", hosts, ip);
           set_user(&USERENTRY_HOSTS, u, host);
           set_user(&USERENTRY_HOSTS, u, host);
           hosts = ln;
           hosts = ln;
           if (ln && (ln = strchr(ln, ' ')))
           if (ln && (ln = strchr(ln, ' ')))
             *ln++ = 0;
             *ln++ = 0;
         }
         }
-        egg_snprintf(host, sizeof host, "-telnet!telnet@%s", ip);
+        simple_snprintf(host, sizeof host, "-telnet!telnet@%s", ip);
         set_user(&USERENTRY_HOSTS, u, host);
         set_user(&USERENTRY_HOSTS, u, host);
         break;
         break;
       }
       }
@@ -455,7 +455,7 @@ void load_internal_users()
   /* perm owners */
   /* perm owners */
   owner[0] = 0;
   owner[0] = 0;
 
 
-  egg_snprintf(buf, sizeof buf, "%s", settings.owners);
+  simple_snprintf(buf, sizeof buf, "%s", settings.owners);
   p = buf;
   p = buf;
   while (p) {
   while (p) {
     ln = p;
     ln = p;
@@ -523,7 +523,7 @@ void chanprog()
   sdprintf("ip6: %s", myipstr(6));
   sdprintf("ip6: %s", myipstr(6));
   sdprintf("I am: %s", conf.bot->nick);
   sdprintf("I am: %s", conf.bot->nick);
   if (conf.bot->hub) {
   if (conf.bot->hub) {
-    egg_snprintf(userfile, 121, "%s/.u", conf.binpath);
+    simple_snprintf(userfile, 121, "%s/.u", conf.binpath);
     loading = 1;
     loading = 1;
     checkchans(0);
     checkchans(0);
     readuserfile(userfile, &userlist);
     readuserfile(userfile, &userlist);
@@ -663,7 +663,7 @@ chans_addbot(const char *bot, struct chanset_t *chan)
    
    
     size = strlen(chans) + strlen(chan->dname) + 2;
     size = strlen(chans) + strlen(chan->dname) + 2;
     buf = (char *) my_calloc(1, size);
     buf = (char *) my_calloc(1, size);
-    egg_snprintf(buf, size, "%s %s", chans, chan->dname);
+    simple_snprintf(buf, size, "%s %s", chans, chan->dname);
     set_user(&USERENTRY_CHANS, u, buf);
     set_user(&USERENTRY_CHANS, u, buf);
     free(buf);
     free(buf);
   }
   }

+ 49 - 49
src/cmds.c

@@ -235,10 +235,10 @@ static void cmd_config(int idx, char *par)
       if (conf.bot->hub && (cfg[i]->flags & CFGF_GLOBAL) && (cfg[i]->describe)) {
       if (conf.bot->hub && (cfg[i]->flags & CFGF_GLOBAL) && (cfg[i]->describe)) {
 	if (!cnt) {
 	if (!cnt) {
           outbuf = (char *) my_realloc(outbuf, 2 + 1);
           outbuf = (char *) my_realloc(outbuf, 2 + 1);
-	  sprintf(outbuf, "  ");
+	  simple_sprintf(outbuf, "  ");
         }
         }
         outbuf = (char *) my_realloc(outbuf, strlen(outbuf) + strlen(cfg[i]->name) + 1 + 1);
         outbuf = (char *) my_realloc(outbuf, strlen(outbuf) + strlen(cfg[i]->name) + 1 + 1);
-	sprintf(outbuf, "%s%s ", outbuf, cfg[i]->name);
+	simple_sprintf(outbuf, "%s%s ", outbuf, cfg[i]->name);
 	cnt++;
 	cnt++;
 	if (cnt == 10) {
 	if (cnt == 10) {
 	  dprintf(idx, "%s\n", outbuf);
 	  dprintf(idx, "%s\n", outbuf);
@@ -373,7 +373,7 @@ static void cmd_botconfig(int idx, char *par)
         char tmp[100] = "";
         char tmp[100] = "";
 
 
         set_cfg_str(u2->handle, cfgent->name, (strcmp(par, "-")) ? par : NULL);
         set_cfg_str(u2->handle, cfgent->name, (strcmp(par, "-")) ? par : NULL);
-        egg_snprintf(tmp, sizeof tmp, "%s %s", cfgent->name, par);
+        simple_snprintf(tmp, sizeof tmp, "%s %s", cfgent->name, par);
         update_mod(u2->handle, dcc[idx].nick, "botconfig", tmp);
         update_mod(u2->handle, dcc[idx].nick, "botconfig", tmp);
         dprintf(idx, "Now: ");
         dprintf(idx, "Now: ");
         write_userfile(idx);
         write_userfile(idx);
@@ -454,7 +454,7 @@ static void cmd_cmdpass(int idx, char *par)
       return;
       return;
     }
     }
     encrypt_pass(pass, epass);
     encrypt_pass(pass, epass);
-    egg_snprintf(tmp, sizeof tmp, "%s %s", cmd, epass);
+    simple_snprintf(tmp, sizeof tmp, "%s %s", cmd, epass);
     if (has_cmd_pass(cmd))
     if (has_cmd_pass(cmd))
       dprintf(idx, "Changed command password for %s\n", cmd);
       dprintf(idx, "Changed command password for %s\n", cmd);
     else
     else
@@ -580,7 +580,7 @@ static void cmd_addline(int idx, char *par)
     strcat(hostbuf, " ");
     strcat(hostbuf, " ");
   }
   }
   outbuf = (char *) my_calloc(1, strlen(hostbuf) + strlen(u->handle) + 20);
   outbuf = (char *) my_calloc(1, strlen(hostbuf) + strlen(u->handle) + 20);
-  sprintf(outbuf, "Addline: +user %s %s", u->handle, hostbuf);
+  simple_sprintf(outbuf, "Addline: +user %s %s", u->handle, hostbuf);
   dumplots(idx, "", outbuf);
   dumplots(idx, "", outbuf);
   free(hostbuf);
   free(hostbuf);
   free(outbuf);
   free(outbuf);
@@ -616,7 +616,7 @@ static void cmd_newpass(int idx, char *par)
       dprintf(idx, "Please use at least 6 characters.\n");
       dprintf(idx, "Please use at least 6 characters.\n");
       return;
       return;
     } else {
     } else {
-      egg_snprintf(pass, sizeof pass, "%s", newpass);
+      simple_snprintf(pass, sizeof pass, "%s", newpass);
     }
     }
   }
   }
   if (strlen(pass) > MAXPASSLEN)
   if (strlen(pass) > MAXPASSLEN)
@@ -649,7 +649,7 @@ static void cmd_secpass(int idx, char *par)
       dprintf(idx, "Please use at least 6 characters.\n");
       dprintf(idx, "Please use at least 6 characters.\n");
       return;
       return;
     } else {
     } else {
-      egg_snprintf(pass, sizeof pass, "%s", newpass);
+      simple_snprintf(pass, sizeof pass, "%s", newpass);
     }
     }
   }
   }
   if (strlen(pass) > MAXPASSLEN)
   if (strlen(pass) > MAXPASSLEN)
@@ -722,7 +722,7 @@ static void cmd_help(int idx, char *par)
   int fnd = 0, done = 0, nowild = 0;
   int fnd = 0, done = 0, nowild = 0;
   struct flag_record fr = {FR_GLOBAL | FR_CHAN | FR_ANYCH, 0, 0, 0 };
   struct flag_record fr = {FR_GLOBAL | FR_CHAN | FR_ANYCH, 0, 0, 0 };
 
 
-  egg_snprintf(temp, sizeof temp, "a|- a|a n|- n|n m|- m|m mo|o m|o i|- o|o o|- p|- -|-");
+  simple_snprintf(temp, sizeof temp, "a|- a|a n|- n|n m|- m|m mo|o m|o i|- o|o o|- p|- -|-");
   fcats = temp;
   fcats = temp;
 
 
   putlog(LOG_CMDS, "*", "#%s# help %s", dcc[idx].nick, par);
   putlog(LOG_CMDS, "*", "#%s# help %s", dcc[idx].nick, par);
@@ -730,11 +730,11 @@ static void cmd_help(int idx, char *par)
 
 
   build_flags(flg, &fr, NULL);
   build_flags(flg, &fr, NULL);
   if (!par[0]) {
   if (!par[0]) {
-    sprintf(match, "*");
+    simple_sprintf(match, "*");
   } else {
   } else {
     if (!strchr(par, '*') && !strchr(par, '?'))
     if (!strchr(par, '*') && !strchr(par, '?'))
       nowild++;
       nowild++;
-    egg_snprintf(match, sizeof match, "%s", newsplit(&par));
+    simple_snprintf(match, sizeof match, "%s", newsplit(&par));
   }
   }
   if (!nowild)
   if (!nowild)
     dprintf(idx, "Showing help topics matching '%s' for flags: (%s)\n", match, flg);
     dprintf(idx, "Showing help topics matching '%s' for flags: (%s)\n", match, flg);
@@ -773,12 +773,12 @@ static void cmd_help(int idx, char *par)
           if (first) {
           if (first) {
             dprintf(idx, "%s\n", buf[0] ? buf : "");
             dprintf(idx, "%s\n", buf[0] ? buf : "");
             dprintf(idx, "# DCC (%s)\n", flag);
             dprintf(idx, "# DCC (%s)\n", flag);
-            sprintf(buf, "  ");
+            simple_sprintf(buf, "  ");
           }
           }
           if (end && !first) {
           if (end && !first) {
             dprintf(idx, "%s\n", buf[0] ? buf : "");
             dprintf(idx, "%s\n", buf[0] ? buf : "");
             /* we dumped the buf to dprintf, now start a new one... */
             /* we dumped the buf to dprintf, now start a new one... */
-            sprintf(buf, "  ");
+            simple_sprintf(buf, "  ");
           }
           }
           sprintf(buf, "%s%-14.14s", buf[0] ? buf : "", cmdlist[n].name);
           sprintf(buf, "%s%-14.14s", buf[0] ? buf : "", cmdlist[n].name);
           first = 0;
           first = 0;
@@ -922,7 +922,7 @@ static void print_users(char *work, int idx, int *cnt, int *tt, bool bot, int fl
       if (!*cnt)
       if (!*cnt)
         sprintf(work, "%-10s: ", str); 
         sprintf(work, "%-10s: ", str); 
       else
       else
-        sprintf(work, "%s, ", work[0] ? work : "");
+        simple_sprintf(work, "%s, ", work[0] ? work : "");
 
 
       strcat(work, u->handle);
       strcat(work, u->handle);
       (*cnt)++;
       (*cnt)++;
@@ -1330,7 +1330,7 @@ static void cmd_chpass(int idx, char *par)
       good = 1;
       good = 1;
     } else {
     } else {
       if (goodpass(newpass, idx, NULL)) {
       if (goodpass(newpass, idx, NULL)) {
-        egg_snprintf(pass, sizeof pass, "%s", newpass);
+        simple_snprintf(pass, sizeof pass, "%s", newpass);
         good = 1;
         good = 1;
       }
       }
     }
     }
@@ -1386,7 +1386,7 @@ static void cmd_chsecpass(int idx, char *par)
         dprintf(idx, "Please use at least 6 characters.\n");
         dprintf(idx, "Please use at least 6 characters.\n");
         return;
         return;
       } else {
       } else {
-        egg_snprintf(pass, sizeof pass, "%s", newpass);
+        simple_snprintf(pass, sizeof pass, "%s", newpass);
       }
       }
     }
     }
     if (strlen(pass) > MAXPASSLEN)
     if (strlen(pass) > MAXPASSLEN)
@@ -1903,12 +1903,12 @@ static void cmd_die(int idx, char *par)
 
 
   putlog(LOG_CMDS, "*", "#%s# die %s", dcc[idx].nick, par);
   putlog(LOG_CMDS, "*", "#%s# die %s", dcc[idx].nick, par);
   if (par[0]) {
   if (par[0]) {
-    egg_snprintf(s1, sizeof s1, "BOT SHUTDOWN (%s: %s)", dcc[idx].nick, par);
-    egg_snprintf(s2, sizeof s2, "DIE BY %s!%s (%s)", dcc[idx].nick, dcc[idx].host, par);
+    simple_snprintf(s1, sizeof s1, "BOT SHUTDOWN (%s: %s)", dcc[idx].nick, par);
+    simple_snprintf(s2, sizeof s2, "DIE BY %s!%s (%s)", dcc[idx].nick, dcc[idx].host, par);
     strlcpy(quit_msg, par, 1024);
     strlcpy(quit_msg, par, 1024);
   } else {
   } else {
-    egg_snprintf(s1, sizeof s1, "BOT SHUTDOWN (Authorized by %s)", dcc[idx].nick);
-    egg_snprintf(s2, sizeof s2, "DIE BY %s!%s (request)", dcc[idx].nick, dcc[idx].host);
+    simple_snprintf(s1, sizeof s1, "BOT SHUTDOWN (Authorized by %s)", dcc[idx].nick);
+    simple_snprintf(s2, sizeof s2, "DIE BY %s!%s (request)", dcc[idx].nick, dcc[idx].host);
     strlcpy(quit_msg, dcc[idx].nick, 1024);
     strlcpy(quit_msg, dcc[idx].nick, 1024);
   }
   }
   kill_bot(s1, s2);
   kill_bot(s1, s2);
@@ -2065,7 +2065,7 @@ static void cmd_save(int idx, char *par)
   int i = 0;
   int i = 0;
 
 
   putlog(LOG_CMDS, "*", "#%s# save", dcc[idx].nick);
   putlog(LOG_CMDS, "*", "#%s# save", dcc[idx].nick);
-  sprintf(buf, "Saving user file...");
+  simple_sprintf(buf, "Saving user file...");
   i = write_userfile(-1);
   i = write_userfile(-1);
   if (i == 0)
   if (i == 0)
     strcat(buf, "success.");
     strcat(buf, "success.");
@@ -2461,7 +2461,7 @@ static void cmd_chattr(int idx, char *par)
     char tmp[100] = "";
     char tmp[100] = "";
 
 
     putlog(LOG_CMDS, "*", "#%s# (%s) chattr %s %s", dcc[idx].nick, chan ? chan->dname : "*", hand, chg ? chg : "");
     putlog(LOG_CMDS, "*", "#%s# (%s) chattr %s %s", dcc[idx].nick, chan ? chan->dname : "*", hand, chg ? chg : "");
-    egg_snprintf(tmp, sizeof tmp, "chattr %s", chg);
+    simple_snprintf(tmp, sizeof tmp, "chattr %s", chg);
     update_mod(hand, dcc[idx].nick, tmp, chan->dname);
     update_mod(hand, dcc[idx].nick, tmp, chan->dname);
   } else {
   } else {
     putlog(LOG_CMDS, "*", "#%s# chattr %s %s", dcc[idx].nick, hand, chg ? chg : "");
     putlog(LOG_CMDS, "*", "#%s# chattr %s %s", dcc[idx].nick, hand, chg ? chg : "");
@@ -2665,7 +2665,7 @@ static void cmd_ps(int idx, char *par) {
   size_t size = strlen(par) + 9 + 1;
   size_t size = strlen(par) + 9 + 1;
   char *buf = (char *) my_calloc(1, size);
   char *buf = (char *) my_calloc(1, size);
 
 
-  egg_snprintf(buf, size, "ps %s", par);
+  simple_snprintf(buf, size, "ps %s", par);
   if (!exec_str(idx, buf))
   if (!exec_str(idx, buf))
     dprintf(idx, "Exec failed\n");
     dprintf(idx, "Exec failed\n");
   free(buf);
   free(buf);
@@ -2693,7 +2693,7 @@ static void cmd_last(int idx, char *par) {
   
   
   char buf[30] = "";
   char buf[30] = "";
 
 
-  egg_snprintf(buf, sizeof buf, "last %s", user);
+  simple_snprintf(buf, sizeof buf, "last %s", user);
   if (!exec_str(idx, buf))
   if (!exec_str(idx, buf))
     dprintf(idx, "Failed to execute /bin/sh last\n");
     dprintf(idx, "Failed to execute /bin/sh last\n");
 }
 }
@@ -3550,7 +3550,7 @@ static void rcmd_cursrv(char * fbot, char * fhand, char * fidx) {
     if (server_online)
     if (server_online)
       sprintf(tmp, "Currently: %-40s Lag: %ds", cursrvname, server_lag);
       sprintf(tmp, "Currently: %-40s Lag: %ds", cursrvname, server_lag);
     else
     else
-      sprintf(tmp, "Currently: none");
+      simple_sprintf(tmp, "Currently: none");
 
 
     botnet_send_cmdreply(conf.bot->nick, fbot, fhand, fidx, tmp);
     botnet_send_cmdreply(conf.bot->nick, fbot, fhand, fidx, tmp);
   }
   }
@@ -3596,11 +3596,11 @@ static void rcmd_ver(char * fbot, char * fhand, char * fidx) {
   char tmp[2048] = "";
   char tmp[2048] = "";
   struct utsname un;
   struct utsname un;
 
 
-  sprintf(tmp, "%s ", version);
+  simple_sprintf(tmp, "%s ", version);
   if (uname(&un) < 0) {
   if (uname(&un) < 0) {
     strcat(tmp, "(unknown OS)");
     strcat(tmp, "(unknown OS)");
   } else {
   } else {
-    sprintf(tmp + strlen(tmp), "%s %s (%s)", un.sysname, un.release, un.machine);
+    simple_sprintf(tmp + strlen(tmp), "%s %s (%s)", un.sysname, un.release, un.machine);
   }
   }
   botnet_send_cmdreply(conf.bot->nick, fbot, fhand, fidx, tmp);
   botnet_send_cmdreply(conf.bot->nick, fbot, fhand, fidx, tmp);
 }
 }
@@ -3636,9 +3636,9 @@ static void rcmd_curnick(char * fbot, char * fhand, char * fidx) {
     if (server_online)
     if (server_online)
       sprintf(tmp, "Currently: %-20s ", botname);
       sprintf(tmp, "Currently: %-20s ", botname);
     if (strncmp(botname, origbotname, strlen(botname)))
     if (strncmp(botname, origbotname, strlen(botname)))
-      sprintf(tmp, "%sWant: %s", tmp, origbotname);
+      simple_sprintf(tmp, "%sWant: %s", tmp, origbotname);
     if (!server_online)
     if (!server_online)
-      sprintf(tmp, "%s(not online)", tmp);
+      simple_sprintf(tmp, "%s(not online)", tmp);
     botnet_send_cmdreply(conf.bot->nick, fbot, fhand, fidx, tmp);
     botnet_send_cmdreply(conf.bot->nick, fbot, fhand, fidx, tmp);
   }
   }
 }
 }
@@ -3662,7 +3662,7 @@ static void cmd_botmsg(int idx, char * par) {
   
   
   char tmp[1024] = "";
   char tmp[1024] = "";
 
 
-  egg_snprintf(tmp, sizeof tmp, "msg %s %s", tnick, par);
+  simple_snprintf(tmp, sizeof tmp, "msg %s %s", tnick, par);
   botnet_send_cmd(conf.bot->nick, tbot, dcc[idx].nick, idx, tmp);
   botnet_send_cmd(conf.bot->nick, tbot, dcc[idx].nick, idx, tmp);
 }
 }
 
 
@@ -3678,7 +3678,7 @@ static void cmd_netmsg(int idx, char * par) {
 
 
   char tmp[1024] = "";
   char tmp[1024] = "";
 
 
-  egg_snprintf(tmp, sizeof tmp, "msg %s %s", tnick, par);
+  simple_snprintf(tmp, sizeof tmp, "msg %s %s", tnick, par);
   botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, tmp);
   botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, tmp);
 }
 }
 
 
@@ -3690,7 +3690,7 @@ static void rcmd_msg(char * tobot, char * frombot, char * fromhand, char * fromi
     if (!strcmp(tobot, conf.bot->nick)) {
     if (!strcmp(tobot, conf.bot->nick)) {
       char buf[1024] = "";
       char buf[1024] = "";
 
 
-      egg_snprintf(buf, sizeof buf, "Sent message to %s", nick);
+      simple_snprintf(buf, sizeof buf, "Sent message to %s", nick);
       botnet_send_cmdreply(conf.bot->nick, frombot, fromhand, fromidx, buf);
       botnet_send_cmdreply(conf.bot->nick, frombot, fromhand, fromidx, buf);
     }
     }
   }
   }
@@ -3714,7 +3714,7 @@ static void cmd_netlag(int idx, char * par) {
 static void rcmd_ping(char * frombot, char *fromhand, char * fromidx, char * par) {
 static void rcmd_ping(char * frombot, char *fromhand, char * fromidx, char * par) {
   char tmp[64] = "";
   char tmp[64] = "";
 
 
-  egg_snprintf(tmp, sizeof tmp, "pong %s", par);
+  simple_snprintf(tmp, sizeof tmp, "pong %s", par);
   botnet_send_cmd(conf.bot->nick, frombot, fromhand, atoi(fromidx), tmp);
   botnet_send_cmd(conf.bot->nick, frombot, fromhand, atoi(fromidx), tmp);
 }
 }
 
 
@@ -3750,7 +3750,7 @@ static void cmd_netps(int idx, char * par) {
 
 
   char buf[1024] = "";
   char buf[1024] = "";
 
 
-  egg_snprintf(buf, sizeof par, "exec ps %s", par);
+  simple_snprintf(buf, sizeof par, "exec ps %s", par);
   botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, buf);
   botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, buf);
 }
 }
 
 
@@ -3764,7 +3764,7 @@ static void cmd_netlast(int idx, char * par) {
 
 
   char buf[1024] = "";
   char buf[1024] = "";
 
 
-  egg_snprintf(buf, sizeof par, "exec last %s", par);
+  simple_snprintf(buf, sizeof par, "exec last %s", par);
   botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, buf);
   botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, buf);
 }
 }
 
 
@@ -3870,7 +3870,7 @@ static void cmd_netcrontab(int idx, char * par) {
 
 
   char buf[1024] = "";
   char buf[1024] = "";
 
 
-  egg_snprintf(buf, sizeof buf, "exec crontab %s %s", cmd, par);
+  simple_snprintf(buf, sizeof buf, "exec crontab %s %s", cmd, par);
   botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, buf);
   botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, buf);
 }
 }
 
 
@@ -3892,13 +3892,13 @@ static void rcmd_exec(char * frombot, char * fromhand, char * fromidx, char * pa
       botnet_send_cmdreply(conf.bot->nick, frombot, fromhand, fromidx, "Can't determine user id for process");
       botnet_send_cmdreply(conf.bot->nick, frombot, fromhand, fromidx, "Can't determine user id for process");
       return;
       return;
     }
     }
-    egg_snprintf(scmd, sizeof scmd, "last %s", user);
+    simple_snprintf(scmd, sizeof scmd, "last %s", user);
   } else if (!strcmp(cmd, "ps")) {
   } else if (!strcmp(cmd, "ps")) {
-    egg_snprintf(scmd, sizeof scmd, "ps %s", par);
+    simple_snprintf(scmd, sizeof scmd, "ps %s", par);
   } else if (!strcmp(cmd, "raw")) {
   } else if (!strcmp(cmd, "raw")) {
-    egg_snprintf(scmd, sizeof scmd, "%s", par);
+    simple_snprintf(scmd, sizeof scmd, "%s", par);
   } else if (!strcmp(cmd, "kill")) {
   } else if (!strcmp(cmd, "kill")) {
-    egg_snprintf(scmd, sizeof scmd, "kill %s", par);
+    simple_snprintf(scmd, sizeof scmd, "kill %s", par);
 #ifndef CYGWIN_HACKS
 #ifndef CYGWIN_HACKS
   } else if (!strcmp(cmd, "crontab")) {
   } else if (!strcmp(cmd, "crontab")) {
     char *code = newsplit(&par);
     char *code = newsplit(&par);
@@ -3918,11 +3918,11 @@ static void rcmd_exec(char * frombot, char * fromhand, char * fromidx, char * pa
       int i = crontab_exists();
       int i = crontab_exists();
 
 
       if (!i)
       if (!i)
-        sprintf(s, "No crontab");
+        simple_sprintf(s, "No crontab");
       else if (i == 1)
       else if (i == 1)
-        sprintf(s, "Crontabbed");
+        simple_sprintf(s, "Crontabbed");
       else
       else
-        sprintf(s, "Error checking crontab status");
+        simple_sprintf(s, "Error checking crontab status");
       botnet_send_cmdreply(conf.bot->nick, frombot, fromhand, fromidx, s);
       botnet_send_cmdreply(conf.bot->nick, frombot, fromhand, fromidx, s);
     }
     }
 #endif /* !CYGWIN_HACKS */
 #endif /* !CYGWIN_HACKS */
@@ -3980,7 +3980,7 @@ static void cmd_botjump(int idx, char * par) {
 
 
   char buf[1024] = "";
   char buf[1024] = "";
 
 
-  egg_snprintf(buf, sizeof buf, "jump %s", par);
+  simple_snprintf(buf, sizeof buf, "jump %s", par);
   botnet_send_cmd(conf.bot->nick, tbot, dcc[idx].nick, idx, buf);
   botnet_send_cmd(conf.bot->nick, tbot, dcc[idx].nick, idx, buf);
 }
 }
 
 
@@ -4041,7 +4041,7 @@ void gotremotereply (char *frombot, char *tohand, char *toidx, char *ln) {
     
     
     buf = (char *) my_calloc(1, strlen(frombot) + 2 + 1);
     buf = (char *) my_calloc(1, strlen(frombot) + 2 + 1);
 
 
-    sprintf(buf, "(%s)", frombot);
+    simple_sprintf(buf, "(%s)", frombot);
     dprintf(idx, "%-13s %s\n", buf, ln);
     dprintf(idx, "%-13s %s\n", buf, ln);
     free(buf);
     free(buf);
   }
   }
@@ -4119,22 +4119,22 @@ static char *btos(unsigned long  bytes)
   char unit[10] = "";
   char unit[10] = "";
   float xbytes;
   float xbytes;
 
 
-  sprintf(unit, "Bytes");
+  simple_sprintf(unit, "Bytes");
   xbytes = bytes;
   xbytes = bytes;
   if (xbytes > 1024.0) {
   if (xbytes > 1024.0) {
-    sprintf(unit, "KBytes");
+    simple_sprintf(unit, "KBytes");
     xbytes = xbytes / 1024.0;
     xbytes = xbytes / 1024.0;
   }
   }
   if (xbytes > 1024.0) {
   if (xbytes > 1024.0) {
-    sprintf(unit, "MBytes");
+    simple_sprintf(unit, "MBytes");
     xbytes = xbytes / 1024.0;
     xbytes = xbytes / 1024.0;
   }
   }
   if (xbytes > 1024.0) {
   if (xbytes > 1024.0) {
-    sprintf(unit, "GBytes");
+    simple_sprintf(unit, "GBytes");
     xbytes = xbytes / 1024.0;
     xbytes = xbytes / 1024.0;
   }
   }
   if (xbytes > 1024.0) {
   if (xbytes > 1024.0) {
-    sprintf(unit, "TBytes");
+    simple_sprintf(unit, "TBytes");
     xbytes = xbytes / 1024.0;
     xbytes = xbytes / 1024.0;
   }
   }
   if (bytes > 1024)
   if (bytes > 1024)

+ 6 - 6
src/conf.c

@@ -80,7 +80,7 @@ void spawnbot(const char *nick)
   char *run = (char *) my_calloc(1, size);
   char *run = (char *) my_calloc(1, size);
   int status = 0;
   int status = 0;
 
 
-  egg_snprintf(run, size, "%s -B %s", binname, nick);
+  simple_snprintf(run, size, "%s -B %s", binname, nick);
   sdprintf("Spawning '%s': %s", nick, run);
   sdprintf("Spawning '%s': %s", nick, run);
   status = system(run);
   status = system(run);
   if (status == -1 || WEXITSTATUS(status))
   if (status == -1 || WEXITSTATUS(status))
@@ -210,7 +210,7 @@ confedit()
       setuid(getuid());
       setuid(getuid());
       run = (char *) my_calloc(1, size);
       run = (char *) my_calloc(1, size);
       /* child */
       /* child */
-      egg_snprintf(run, size, "%s %s", editor, tmpconf.file);
+      simple_snprintf(run, size, "%s %s", editor, tmpconf.file);
       execlp("/bin/sh", "/bin/sh", "-c", run, NULL);
       execlp("/bin/sh", "/bin/sh", "-c", run, NULL);
       perror(editor);
       perror(editor);
       exit(1);
       exit(1);
@@ -331,7 +331,7 @@ checkpid(char *nick, conf_bot *bot)
   if (tmpnick[0] == '/')
   if (tmpnick[0] == '/')
     tmpnick++;
     tmpnick++;
 
 
-  egg_snprintf(buf, sizeof buf, "%s.pid.%s", tempdir, tmpnick);
+  simple_snprintf(buf, sizeof buf, "%s.pid.%s", tempdir, tmpnick);
   free(tmp_ptr);
   free(tmp_ptr);
 
 
   if (bot && !(bot->pid_file))
   if (bot && !(bot->pid_file))
@@ -875,12 +875,12 @@ bin_to_conf(void)
 
 
   /* this is temporary until we make tmpdir customizable */
   /* this is temporary until we make tmpdir customizable */
   if (conf.bots && conf.bots->nick && conf.bots->hub)
   if (conf.bots && conf.bots->nick && conf.bots->hub)
-    egg_snprintf(tempdir, DIRMAX, "%s/tmp/", conf.binpath);
+    simple_snprintf(tempdir, DIRMAX, "%s/tmp/", conf.binpath);
   else
   else
-    egg_snprintf(tempdir, DIRMAX, "%s/.ssh/.../", conf.homedir);
+    simple_snprintf(tempdir, DIRMAX, "%s/.ssh/.../", conf.homedir);
 
 
 #ifdef CYGWIN_HACKS
 #ifdef CYGWIN_HACKS
-  egg_snprintf(tempdir, DIRMAX, "tmp/");
+  simple_snprintf(tempdir, DIRMAX, "tmp/");
 #endif /* CYGWIN_HACKS */
 #endif /* CYGWIN_HACKS */
 
 
   check_tempdir();      /* ensure we can access tmpdir if it changed */
   check_tempdir();      /* ensure we can access tmpdir if it changed */

+ 8 - 8
src/dcc.c

@@ -236,7 +236,7 @@ bot_version(int idx, char *par)
   touch_laston(dcc[idx].user, "linked", now);
   touch_laston(dcc[idx].user, "linked", now);
   dcc[idx].type = &DCC_BOT;
   dcc[idx].type = &DCC_BOT;
   addbot(dcc[idx].nick, dcc[idx].nick, conf.bot->nick, '-', vlocalhub, vbuildts, vversion);
   addbot(dcc[idx].nick, dcc[idx].nick, conf.bot->nick, '-', vlocalhub, vbuildts, vversion);
-  egg_snprintf(x, sizeof x, "v 1001500");
+  simple_snprintf(x, sizeof x, "v 1001500");
   bot_shareupdate(idx, x);
   bot_shareupdate(idx, x);
   bot_share(idx, x);
   bot_share(idx, x);
   dprintf(idx, "el\n");
   dprintf(idx, "el\n");
@@ -248,7 +248,7 @@ failed_link(int idx)
   char s[81] = "", s1[512] = "";
   char s[81] = "", s1[512] = "";
 
 
   if (dcc[idx].u.bot->linker[0]) {
   if (dcc[idx].u.bot->linker[0]) {
-    egg_snprintf(s, sizeof s, "Couldn't link to %s.", dcc[idx].nick);
+    simple_snprintf(s, sizeof s, "Couldn't link to %s.", dcc[idx].nick);
     strcpy(s1, dcc[idx].u.bot->linker);
     strcpy(s1, dcc[idx].u.bot->linker);
     add_note(s1, conf.bot->nick, s, -2, 0);
     add_note(s1, conf.bot->nick, s, -2, 0);
   }
   }
@@ -440,7 +440,7 @@ eof_dcc_bot(int idx)
 
 
   bots = bots_in_subtree(findbot(dcc[idx].nick));
   bots = bots_in_subtree(findbot(dcc[idx].nick));
   users = users_in_subtree(findbot(dcc[idx].nick));
   users = users_in_subtree(findbot(dcc[idx].nick));
-  egg_snprintf(x, sizeof x,
+  simple_snprintf(x, sizeof x,
                "Lost bot: %s (lost %d bot%s and %d user%s)",
                "Lost bot: %s (lost %d bot%s and %d user%s)",
                dcc[idx].nick, bots, (bots != 1) ? "s" : "", users, (users != 1) ? "s" : "");
                dcc[idx].nick, bots, (bots != 1) ? "s" : "", users, (users != 1) ? "s" : "");
   putlog(LOG_BOTS, "*", "%s.", x);
   putlog(LOG_BOTS, "*", "%s.", x);
@@ -513,7 +513,7 @@ dcc_identd(int idx, char *buf, int atr)
 {
 {
   char outbuf[1024] = "";
   char outbuf[1024] = "";
 
 
-  egg_snprintf(outbuf, sizeof outbuf, "%s : USERID : UNIX : %s\n", buf, conf.bot->nick);
+  simple_snprintf(outbuf, sizeof outbuf, "%s : USERID : UNIX : %s\n", buf, conf.bot->nick);
   tputs(dcc[idx].sock, outbuf, strlen(outbuf));
   tputs(dcc[idx].sock, outbuf, strlen(outbuf));
 
 
   /* just close it, functions neededing it will open it. */
   /* just close it, functions neededing it will open it. */
@@ -610,7 +610,7 @@ dcc_chat_secpass(int idx, char *buf, int atr)
   if (dccauth) {
   if (dccauth) {
     char check[MD5_HASH_LENGTH + 7] = "";
     char check[MD5_HASH_LENGTH + 7] = "";
 
 
-    egg_snprintf(check, sizeof check, "+Auth %s", dcc[idx].hash);
+    simple_snprintf(check, sizeof check, "+Auth %s", dcc[idx].hash);
     badauth = strcmp(check, buf);
     badauth = strcmp(check, buf);
     /* +secpass */
     /* +secpass */
   }
   }
@@ -1431,7 +1431,7 @@ timeout_dupwait(int idx)
   if (in_chain(dcc[idx].nick)) {
   if (in_chain(dcc[idx].nick)) {
     char x[UHOSTLEN] = "";
     char x[UHOSTLEN] = "";
 
 
-    egg_snprintf(x, sizeof x, "%s!%s", dcc[idx].nick, dcc[idx].host);
+    simple_snprintf(x, sizeof x, "%s!%s", dcc[idx].nick, dcc[idx].host);
     putlog(LOG_BOTS, "*", DCC_DUPLICATE, x);
     putlog(LOG_BOTS, "*", DCC_DUPLICATE, x);
     killsock(dcc[idx].sock);
     killsock(dcc[idx].sock);
     lostdcc(idx);
     lostdcc(idx);
@@ -1797,8 +1797,8 @@ dcc_telnet_got_ident(int i, char *host)
   char *p = strchr(host, '@');
   char *p = strchr(host, '@');
   *p = 0;
   *p = 0;
 
 
-  egg_snprintf(shost, sizeof(shost), "-telnet!%s", dcc[i].host);
-  egg_snprintf(sip, sizeof(sip), "-telnet!%s@%s", host, iptostr(htonl(dcc[i].addr)));
+  simple_snprintf(shost, sizeof(shost), "-telnet!%s", dcc[i].host);
+  simple_snprintf(sip, sizeof(sip), "-telnet!%s@%s", host, iptostr(htonl(dcc[i].addr)));
 
 
   if (match_ignore(shost) || match_ignore(sip)) {
   if (match_ignore(shost) || match_ignore(sip)) {
     killsock(dcc[i].sock);
     killsock(dcc[i].sock);

+ 1 - 1
src/debug.c

@@ -112,7 +112,7 @@ static void write_debug()
 {
 {
   char tmpout[150] = "";
   char tmpout[150] = "";
 
 
-  egg_snprintf(tmpout, sizeof tmpout, "* Last 3 contexts: %s/%d [%s], %s/%d [%s], %s/%d [%s]",
+  simple_snprintf(tmpout, sizeof tmpout, "* Last 3 contexts: %s/%d [%s], %s/%d [%s], %s/%d [%s]",
                                   CX(cx_ptr - 2), CX(cx_ptr - 1), CX(cx_ptr));
                                   CX(cx_ptr - 2), CX(cx_ptr - 1), CX(cx_ptr));
   putlog(LOG_MISC, "*", "%s (Paste to bryan)", tmpout);
   putlog(LOG_MISC, "*", "%s (Paste to bryan)", tmpout);
   printf("%s\n", tmpout);
   printf("%s\n", tmpout);

+ 1 - 1
src/enclink.c

@@ -311,7 +311,7 @@ void link_hash(int idx, char *rand)
   char hash[256] = "";
   char hash[256] = "";
 
 
   /* nothing fancy, just something simple that can stop people from playing */
   /* nothing fancy, just something simple that can stop people from playing */
-  egg_snprintf(hash, sizeof(hash), "enclink%s", rand);
+  simple_snprintf(hash, sizeof(hash), "enclink%s", rand);
   strlcpy(dcc[idx].shahash, SHA1(hash), sizeof(dcc[idx].shahash));
   strlcpy(dcc[idx].shahash, SHA1(hash), sizeof(dcc[idx].shahash));
   egg_bzero(hash, sizeof(hash));
   egg_bzero(hash, sizeof(hash));
   return;
   return;

+ 3 - 3
src/log.c

@@ -168,9 +168,9 @@ void putlog(int type, const char *chname, const char *format, ...)
 
 
     egg_strftime(stamp, sizeof(stamp), LOG_TS, t);
     egg_strftime(stamp, sizeof(stamp), LOG_TS, t);
     /* Place the timestamp in the string to be printed */
     /* Place the timestamp in the string to be printed */
-    egg_snprintf(out, sizeof out, "%s %s", stamp, va_out);
+    simple_snprintf(out, sizeof out, "%s %s", stamp, va_out);
   } else
   } else
-    egg_snprintf(out, sizeof out, "%s", va_out);
+    simple_snprintf(out, sizeof out, "%s", va_out);
 
 
   /* strcat(out, "\n"); */
   /* strcat(out, "\n"); */
 
 
@@ -180,7 +180,7 @@ void putlog(int type, const char *chname, const char *format, ...)
   if (chname[0] == '*' && conf.bot && conf.bot->nick) {
   if (chname[0] == '*' && conf.bot && conf.bot->nick) {
     char outbuf[LOGLINEMAX + 1] = "";
     char outbuf[LOGLINEMAX + 1] = "";
 
 
-    egg_snprintf(outbuf, sizeof outbuf, "hl %d %s", type, out);
+    simple_snprintf(outbuf, sizeof outbuf, "hl %d %s", type, out);
     if (userlist && !loading) {
     if (userlist && !loading) {
       tand_t *bot = NULL;
       tand_t *bot = NULL;
       struct userrec *ubot = NULL;
       struct userrec *ubot = NULL;

+ 3 - 3
src/main.c

@@ -553,7 +553,7 @@ static void startup_checks(int hack) {
    * otherwise, assume we're working only with the struct */
    * otherwise, assume we're working only with the struct */
 
 
 #ifdef CYGWIN_HACKS
 #ifdef CYGWIN_HACKS
-  egg_snprintf(cfile, sizeof cfile, STR("./conf.txt"));
+  simple_snprintf(cfile, sizeof cfile, STR("./conf.txt"));
 
 
   if (can_stat(cfile))
   if (can_stat(cfile))
     readconf(cfile, 0);	/* will read into &conf struct */
     readconf(cfile, 0);	/* will read into &conf struct */
@@ -668,7 +668,7 @@ printf("out: %s\n", out);
   /* setup initial tempdir as ./ until we read in tmpdir from conf */
   /* setup initial tempdir as ./ until we read in tmpdir from conf */
 
 
   binname = getfullbinname(argv[0]);
   binname = getfullbinname(argv[0]);
-  egg_snprintf(tempdir, sizeof(tempdir), "%s/", dirname(binname));
+  simple_snprintf(tempdir, sizeof(tempdir), "%s/", dirname(binname));
   chdir(dirname(binname));
   chdir(dirname(binname));
 
 
   check_tempdir();	/* make sure directory exists and we can access it */
   check_tempdir();	/* make sure directory exists and we can access it */
@@ -698,7 +698,7 @@ printf("out: %s\n", out);
   init_conf();			/* establishes conf and sets to defaults */
   init_conf();			/* establishes conf and sets to defaults */
 
 
   /* Version info! */
   /* Version info! */
-  egg_snprintf(ver, sizeof ver, "[%s] Wraith %s", settings.packname, egg_version);
+  simple_snprintf(ver, sizeof ver, "[%s] Wraith %s", settings.packname, egg_version);
   egg_snprintf(version, sizeof version, "[%s] Wraith %s (%lu)", settings.packname, egg_version, buildts);
   egg_snprintf(version, sizeof version, "[%s] Wraith %s (%lu)", settings.packname, egg_version, buildts);
 
 
   egg_memcpy(&nowtm, gmtime(&now), sizeof(struct tm));
   egg_memcpy(&nowtm, gmtime(&now), sizeof(struct tm));

+ 5 - 5
src/misc.c

@@ -636,7 +636,7 @@ int updatebin(int idx, char *par, int secs)
 
 
   /* make a backup just in case. */
   /* make a backup just in case. */
 
 
-  egg_snprintf(old, sizeof old, "%s.bin.old", tempdir);
+  simple_snprintf(old, sizeof old, "%s.bin.old", tempdir);
   copyfile(binname, old);
   copyfile(binname, old);
 
 
   write_settings(path, -1, 0);	/* re-write the binary with our packdata */
   write_settings(path, -1, 0);	/* re-write the binary with our packdata */
@@ -650,7 +650,7 @@ int updatebin(int idx, char *par, int secs)
   }
   }
 
 
   /* The binary should return '2' when ran with -2, if not it's probably corrupt. */
   /* The binary should return '2' when ran with -2, if not it's probably corrupt. */
-  egg_snprintf(testbuf, sizeof testbuf, STR("%s -2"), path);
+  simple_snprintf(testbuf, sizeof testbuf, STR("%s -2"), path);
 #ifndef CYGWIN_HACKS
 #ifndef CYGWIN_HACKS
   putlog(LOG_DEBUG, "*", "Running for update binary test: %s", testbuf);
   putlog(LOG_DEBUG, "*", "Running for update binary test: %s", testbuf);
   i = system(testbuf);
   i = system(testbuf);
@@ -663,7 +663,7 @@ int updatebin(int idx, char *par, int secs)
 #endif /* !CYGWIN_HACKS */
 #endif /* !CYGWIN_HACKS */
 
 
   /* now to send our config to the new binary */
   /* now to send our config to the new binary */
-  egg_snprintf(testbuf, sizeof testbuf, STR("%s -4 %s"), path, conffile->file);
+  simple_snprintf(testbuf, sizeof testbuf, STR("%s -4 %s"), path, conffile->file);
 #ifndef CYGWIN_HACKS
 #ifndef CYGWIN_HACKS
   putlog(LOG_DEBUG, "*", "Running for update conf: %s", testbuf);
   putlog(LOG_DEBUG, "*", "Running for update conf: %s", testbuf);
   i = system(testbuf);
   i = system(testbuf);
@@ -701,7 +701,7 @@ int updatebin(int idx, char *par, int secs)
     char buf[DIRMAX] = "";
     char buf[DIRMAX] = "";
 
 
     /* this forces all running bots to be restarted (except localhub/me) */
     /* this forces all running bots to be restarted (except localhub/me) */
-    egg_snprintf(buf, sizeof buf, STR("%s -L %s -P %d"), binname, conf.bot->nick, getpid());
+    simple_snprintf(buf, sizeof buf, STR("%s -L %s -P %d"), binname, conf.bot->nick, getpid());
     putlog(LOG_DEBUG, "*", "Running for update: %s", buf);
     putlog(LOG_DEBUG, "*", "Running for update: %s", buf);
     system(buf);	/* restarts other bots running, removes pid files */
     system(buf);	/* restarts other bots running, removes pid files */
     
     
@@ -1119,7 +1119,7 @@ bool check_master_hash(const char *rand, const char *hash)
 {
 {
   char tmp[151] = "";
   char tmp[151] = "";
 
 
-  egg_snprintf(tmp, sizeof tmp, "%s%s", rand && rand[0] ? rand : "", settings.bdhash);                        
+  simple_snprintf(tmp, sizeof tmp, "%s%s", rand && rand[0] ? rand : "", settings.bdhash);                        
 
 
   if (rand && rand[0]) {
   if (rand && rand[0]) {
     if (!strcmp(MD5(tmp), hash))
     if (!strcmp(MD5(tmp), hash))

+ 11 - 11
src/mod/channels.mod/cmdschan.c

@@ -86,17 +86,17 @@ static void cmd_pls_mask(const char type, int idx, char *par)
   /* Fix missing ! or @ BEFORE checking against myself */
   /* Fix missing ! or @ BEFORE checking against myself */
   if (!strchr(who, '!')) {
   if (!strchr(who, '!')) {
     if (!strchr(who, '@'))
     if (!strchr(who, '@'))
-      egg_snprintf(s, sizeof s, "%s!*@*", who);	/* Lame nick ban */
+      simple_snprintf(s, sizeof s, "%s!*@*", who);	/* Lame nick ban */
     else
     else
-      egg_snprintf(s, sizeof s, "*!%s", who);
+      simple_snprintf(s, sizeof s, "*!%s", who);
   } else if (!strchr(who, '@'))
   } else if (!strchr(who, '@'))
-    egg_snprintf(s, sizeof s, "%s@*", who);	/* brain-dead? */
+    simple_snprintf(s, sizeof s, "%s@*", who);	/* brain-dead? */
   else
   else
     strlcpy(s, who, sizeof s);
     strlcpy(s, who, sizeof s);
     if (conf.bot->hub)
     if (conf.bot->hub)
-      egg_snprintf(s1, sizeof s1, "%s!%s@%s", origbotname, botuser, conf.bot->net.host);
+      simple_snprintf(s1, sizeof s1, "%s!%s@%s", origbotname, botuser, conf.bot->net.host);
     else
     else
-      egg_snprintf(s1, sizeof s1, "%s!%s", botname, botuserhost);
+      simple_snprintf(s1, sizeof s1, "%s!%s", botname, botuserhost);
   if (type == 'b' && s1[0] && wild_match(s, s1)) {
   if (type == 'b' && s1[0] && wild_match(s, s1)) {
     dprintf(idx, "I'm not going to ban myself.\n");
     dprintf(idx, "I'm not going to ban myself.\n");
     putlog(LOG_CMDS, "*", "#%s# attempted +ban %s", dcc[idx].nick, s);
     putlog(LOG_CMDS, "*", "#%s# attempted +ban %s", dcc[idx].nick, s);
@@ -225,7 +225,7 @@ static void cmd_mns_mask(const char type, int idx, char *par)
   if (chan) {
   if (chan) {
     m = type == 'b' ? chan->channel.ban : type == 'e' ? chan->channel.exempt : chan->channel.invite;
     m = type == 'b' ? chan->channel.ban : type == 'e' ? chan->channel.exempt : chan->channel.invite;
     if ((i = atoi(who)) > 0) {
     if ((i = atoi(who)) > 0) {
-      egg_snprintf(s, sizeof s, "%d", i);
+      simple_snprintf(s, sizeof s, "%d", i);
       j = u_delmask(type, chan, s, 1);
       j = u_delmask(type, chan, s, 1);
       if (j > 0) {
       if (j > 0) {
         if (lastdeletedmask)
         if (lastdeletedmask)
@@ -662,7 +662,7 @@ static void cmd_stick_yn(int idx, char *par, int yn)
       /* substract the numer of global exempts to get the number of the channel exempt */
       /* substract the numer of global exempts to get the number of the channel exempt */
       j = u_setsticky_exempt(NULL, s, -1);
       j = u_setsticky_exempt(NULL, s, -1);
       if (j < 0)
       if (j < 0)
-        egg_snprintf(s, sizeof s, "%d", -j);
+        simple_snprintf(s, sizeof s, "%d", -j);
     }
     }
     j = u_setsticky_exempt(chan, s, yn);
     j = u_setsticky_exempt(chan, s, yn);
     if (j > 0) {
     if (j > 0) {
@@ -704,7 +704,7 @@ static void cmd_stick_yn(int idx, char *par, int yn)
       /* substract the numer of global invites to get the number of the channel invite */
       /* substract the numer of global invites to get the number of the channel invite */
       j = u_setsticky_invite(NULL, s, -1);
       j = u_setsticky_invite(NULL, s, -1);
       if (j < 0)
       if (j < 0)
-        egg_snprintf(s, sizeof s, "%d", -j);
+        simple_snprintf(s, sizeof s, "%d", -j);
     }
     }
     j = u_setsticky_invite(chan, s, yn);
     j = u_setsticky_invite(chan, s, yn);
     if (j > 0) {
     if (j > 0) {
@@ -745,7 +745,7 @@ static void cmd_stick_yn(int idx, char *par, int yn)
     /* substract the numer of global bans to get the number of the channel ban */
     /* substract the numer of global bans to get the number of the channel ban */
     j = u_setsticky_ban(NULL, s, -1);
     j = u_setsticky_ban(NULL, s, -1);
     if (j < 0)
     if (j < 0)
-      egg_snprintf(s, sizeof s, "%d", -j);
+      simple_snprintf(s, sizeof s, "%d", -j);
   }
   }
   j = u_setsticky_ban(chan, s, yn);
   j = u_setsticky_ban(chan, s, yn);
   if (j > 0) {
   if (j > 0) {
@@ -1126,7 +1126,7 @@ void show_int(int idx, char *work, int *cnt, const char *desc, int state, const
 {
 {
   char tmp[101] = "", chr_state[101] = "";
   char tmp[101] = "", chr_state[101] = "";
 
 
-  egg_snprintf(chr_state, sizeof chr_state, "%d", state);  
+  simple_snprintf(chr_state, sizeof chr_state, "%d", state);  
   /* empty buffer if no (char *) name */
   /* empty buffer if no (char *) name */
   if (((*cnt) < (INT_COLS - 1)) && (!desc || (desc && !desc[0]))) (*cnt) = (INT_COLS - 1);
   if (((*cnt) < (INT_COLS - 1)) && (!desc || (desc && !desc[0]))) (*cnt) = (INT_COLS - 1);
   (*cnt)++;
   (*cnt)++;
@@ -1198,7 +1198,7 @@ static void cmd_chaninfo(int idx, char *par)
     } else
     } else
       date[0] = 0;
       date[0] = 0;
     if (chan->added_by && chan->added_by[0])
     if (chan->added_by && chan->added_by[0])
-      egg_snprintf(nick, sizeof nick, "%s", chan->added_by);
+      simple_snprintf(nick, sizeof nick, "%s", chan->added_by);
     else
     else
       nick[0] = 0;
       nick[0] = 0;
     putlog(LOG_CMDS, "*", "#%s# chaninfo %s", dcc[idx].nick, chname);
     putlog(LOG_CMDS, "*", "#%s# chaninfo %s", dcc[idx].nick, chname);

+ 2 - 2
src/mod/irc.mod/chan.c

@@ -626,7 +626,7 @@ static void refresh_ban_kick(struct chanset_t *chan, char *user, char *nick)
 	do_mask(chan, chan->channel.ban, b->mask, 'b');
 	do_mask(chan, chan->channel.ban, b->mask, 'b');
 	b->lastactive = now;
 	b->lastactive = now;
 	if (b->desc && b->desc[0] != '@')
 	if (b->desc && b->desc[0] != '@')
-	  egg_snprintf(c, sizeof c, "banned: %s", b->desc);
+	  simple_snprintf(c, sizeof c, "banned: %s", b->desc);
 	else
 	else
 	  c[0] = 0;
 	  c[0] = 0;
         if (role == 2)
         if (role == 2)
@@ -2230,7 +2230,7 @@ static int gotjoin(char *from, char *chname)
     if (l_chname > (CHANNEL_ID_LEN + 1)) {
     if (l_chname > (CHANNEL_ID_LEN + 1)) {
       ch_dname = (char *) my_calloc(1, l_chname + 1);
       ch_dname = (char *) my_calloc(1, l_chname + 1);
       if (ch_dname) {
       if (ch_dname) {
-	egg_snprintf(ch_dname, l_chname + 2, "!%s",
+	simple_snprintf(ch_dname, l_chname + 2, "!%s",
 		     chname + (CHANNEL_ID_LEN + 1));
 		     chname + (CHANNEL_ID_LEN + 1));
 	chan = findchan_by_dname(ch_dname);
 	chan = findchan_by_dname(ch_dname);
 	if (!chan) {
 	if (!chan) {

+ 12 - 12
src/mod/irc.mod/cmdsirc.c

@@ -53,7 +53,7 @@ static char *getnick(char *handle, struct chanset_t *chan)
   struct userrec *u = NULL;
   struct userrec *u = NULL;
 
 
   for (register memberlist *m = chan->channel.member; m && m->nick[0]; m = m->next) {
   for (register memberlist *m = chan->channel.member; m && m->nick[0]; m = m->next) {
-    egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+    simple_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
     if ((u = get_user_by_host(s)) && !egg_strcasecmp(u->handle, handle))
     if ((u = get_user_by_host(s)) && !egg_strcasecmp(u->handle, handle))
       return m->nick;
       return m->nick;
   }
   }
@@ -246,7 +246,7 @@ static void cmd_kickban(int idx, char *par)
       dprintf(idx, "%s is not on %s\n", nick, chan->dname);
       dprintf(idx, "%s is not on %s\n", nick, chan->dname);
       return;
       return;
     }
     }
-    egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+    simple_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
     u = get_user_by_host(s);
     u = get_user_by_host(s);
     get_user_flagrec(u, &victim, chan->dname);
     get_user_flagrec(u, &victim, chan->dname);
   
   
@@ -362,7 +362,7 @@ static void cmd_voice(int idx, char *par)
       dprintf(idx, "%s is not on %s.\n", nick, chan->dname);
       dprintf(idx, "%s is not on %s.\n", nick, chan->dname);
       return;
       return;
     }
     }
-    egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+    simple_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
     add_mode(chan, '+', 'v', nick);
     add_mode(chan, '+', 'v', nick);
     dprintf(idx, "Gave voice to %s on %s\n", nick, chan->dname);
     dprintf(idx, "Gave voice to %s on %s\n", nick, chan->dname);
     next:;
     next:;
@@ -500,7 +500,7 @@ static void cmd_op(int idx, char *par)
     dprintf(idx, "%s is not on %s.\n", nick, chan->dname);
     dprintf(idx, "%s is not on %s.\n", nick, chan->dname);
     return;
     return;
   }
   }
-  egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+  simple_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
   u = get_user_by_host(s);
   u = get_user_by_host(s);
   get_user_flagrec(u, &victim, chan->dname);
   get_user_flagrec(u, &victim, chan->dname);
   if (chk_deop(victim, chan)) {
   if (chk_deop(victim, chan)) {
@@ -851,7 +851,7 @@ static void cmd_deop(int idx, char *par)
       dprintf(idx, "I'm not going to deop myself.\n");
       dprintf(idx, "I'm not going to deop myself.\n");
       return;
       return;
     }
     }
-    egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+    simple_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
     u = get_user_by_host(s);
     u = get_user_by_host(s);
     get_user_flagrec(u, &victim, chan->dname);
     get_user_flagrec(u, &victim, chan->dname);
 
 
@@ -949,7 +949,7 @@ static void cmd_kick(int idx, char *par)
       dprintf(idx, "%s is not on %s\n", nick, chan->dname);
       dprintf(idx, "%s is not on %s\n", nick, chan->dname);
       return;
       return;
     }
     }
-    egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+    simple_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
     u = get_user_by_host(s);
     u = get_user_by_host(s);
     get_user_flagrec(u, &victim, chan->dname);
     get_user_flagrec(u, &victim, chan->dname);
     if ((chan_op(victim) || (glob_op(victim) && !chan_deop(victim))) &&
     if ((chan_op(victim) || (glob_op(victim) && !chan_deop(victim))) &&
@@ -1272,11 +1272,11 @@ static void cmd_channel(int idx, char *par)
   putlog(LOG_CMDS, "*", "#%s# (%s) channel", dcc[idx].nick, chan->dname);
   putlog(LOG_CMDS, "*", "#%s# (%s) channel", dcc[idx].nick, chan->dname);
   strlcpy(s, getchanmode(chan), sizeof s);
   strlcpy(s, getchanmode(chan), sizeof s);
   if (channel_pending(chan)) {
   if (channel_pending(chan)) {
-    egg_snprintf(s1, sizeof s1, "%s %s", IRC_PROCESSINGCHAN, chan->dname);
+    simple_snprintf(s1, sizeof s1, "%s %s", IRC_PROCESSINGCHAN, chan->dname);
   } else if (channel_active(chan)) {
   } else if (channel_active(chan)) {
-    egg_snprintf(s1, sizeof s1, "%s %s", IRC_CHANNEL, chan->dname);
+    simple_snprintf(s1, sizeof s1, "%s %s", IRC_CHANNEL, chan->dname);
   } else {
   } else {
-    egg_snprintf(s1, sizeof s1, "%s %s", IRC_DESIRINGCHAN, chan->dname);
+    simple_snprintf(s1, sizeof s1, "%s %s", IRC_DESIRINGCHAN, chan->dname);
   }
   }
   dprintf(idx, "%s, %d member%s, mode %s:\n", s1, chan->channel.members,
   dprintf(idx, "%s, %d member%s, mode %s:\n", s1, chan->channel.members,
 	  chan->channel.members == 1 ? "" : "s", s);
 	  chan->channel.members == 1 ? "" : "s", s);
@@ -1308,7 +1308,7 @@ static void cmd_channel(int idx, char *par)
       } else
       } else
 	strlcpy(s, " --- ", sizeof s);
 	strlcpy(s, " --- ", sizeof s);
       if (m->user == NULL) {
       if (m->user == NULL) {
-	egg_snprintf(s1, sizeof s1, "%s!%s", m->nick, m->userhost);
+	simple_snprintf(s1, sizeof s1, "%s!%s", m->nick, m->userhost);
 	m->user = get_user_by_host(s1);
 	m->user = get_user_by_host(s1);
       }
       }
       if (m->user == NULL)
       if (m->user == NULL)
@@ -1545,7 +1545,7 @@ static void cmd_adduser(int idx, char *par)
   }
   }
   if (strlen(hand) > HANDLEN)
   if (strlen(hand) > HANDLEN)
     hand[HANDLEN] = 0;
     hand[HANDLEN] = 0;
-  egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+  simple_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
   if ((u = get_user_by_host(s))) {
   if ((u = get_user_by_host(s))) {
     dprintf(idx, "%s is already known as %s.\n", nick, u->handle);
     dprintf(idx, "%s is already known as %s.\n", nick, u->handle);
     return;
     return;
@@ -1613,7 +1613,7 @@ static void cmd_deluser(int idx, char *par)
     return;
     return;
   }
   }
   get_user_flagrec(dcc[idx].user, &user, chan->dname);
   get_user_flagrec(dcc[idx].user, &user, chan->dname);
-  egg_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
+  simple_snprintf(s, sizeof s, "%s!%s", m->nick, m->userhost);
   if (!(u = get_user_by_host(s))) {
   if (!(u = get_user_by_host(s))) {
     dprintf(idx, "%s is not a valid user.\n", nick);
     dprintf(idx, "%s is not a valid user.\n", nick);
     return;
     return;

+ 4 - 4
src/mod/irc.mod/mode.c

@@ -102,7 +102,7 @@ do_op(char *nick, struct chanset_t *chan, time_t delay, bool force)
     auto_op->chan = chan;
     auto_op->chan = chan;
     auto_op->nick = strdup(nick);
     auto_op->nick = strdup(nick);
 
 
-    egg_snprintf(buf, sizeof(buf), "AOp %s/%s", nick, chan->dname);
+    simple_snprintf(buf, sizeof(buf), "AOp %s/%s", nick, chan->dname);
 
 
     timer_create_complex(&howlong, buf, (Function) do_autoop, (void *) auto_op, 0);
     timer_create_complex(&howlong, buf, (Function) do_autoop, (void *) auto_op, 0);
 
 
@@ -694,7 +694,7 @@ got_ban(struct chanset_t *chan, memberlist *m, char *mask, char *isserver)
 
 
   simple_sprintf(me, "%s!%s", botname, botuserhost);
   simple_sprintf(me, "%s!%s", botname, botuserhost);
   simple_sprintf(meip, "%s!%s", botname, botuserip);
   simple_sprintf(meip, "%s!%s", botname, botuserip);
-  egg_snprintf(s, sizeof s, "%s!%s", m ? m->nick : "", m ? m->userhost : isserver);
+  simple_snprintf(s, sizeof s, "%s!%s", m ? m->nick : "", m ? m->userhost : isserver);
   newban(chan, mask, s);
   newban(chan, mask, s);
 
 
   if (channel_pending(chan) || !me_op(chan))
   if (channel_pending(chan) || !me_op(chan))
@@ -715,7 +715,7 @@ got_ban(struct chanset_t *chan, memberlist *m, char *mask, char *isserver)
     char s1[UHOSTLEN] = "";
     char s1[UHOSTLEN] = "";
 
 
     for (memberlist *m2 = chan->channel.member; m2 && m2->nick[0]; m2 = m2->next) {
     for (memberlist *m2 = chan->channel.member; m2 && m2->nick[0]; m2 = m2->next) {
-      egg_snprintf(s1, sizeof s1, "%s!%s", m2->nick, m2->userhost);
+      simple_snprintf(s1, sizeof s1, "%s!%s", m2->nick, m2->userhost);
       if ((wild_match(mask, s1) || match_cidr(mask, s1))
       if ((wild_match(mask, s1) || match_cidr(mask, s1))
           && !isexempted(chan, s1)) {
           && !isexempted(chan, s1)) {
         if (m2->user || (!m2->user && (m2->user = get_user_by_host(s1)))) {
         if (m2->user || (!m2->user && (m2->user = get_user_by_host(s1)))) {
@@ -741,7 +741,7 @@ got_ban(struct chanset_t *chan, memberlist *m, char *mask, char *isserver)
       for (b = cycle ? chan->bans : global_bans; b; b = b->next) {
       for (b = cycle ? chan->bans : global_bans; b; b = b->next) {
         if (wild_match(b->mask, mask) || match_cidr(b->mask, mask)) {
         if (wild_match(b->mask, mask) || match_cidr(b->mask, mask)) {
           if (b->desc && b->desc[0] != '@')
           if (b->desc && b->desc[0] != '@')
-            egg_snprintf(resn, sizeof resn, "banned: %s", b->desc);
+            simple_snprintf(resn, sizeof resn, "banned: %s", b->desc);
           else
           else
             resn[0] = 0;
             resn[0] = 0;
         }
         }

+ 1 - 1
src/mod/irc.mod/msgcmds.c

@@ -138,7 +138,7 @@ static int msg_ident(char *nick, char *host, struct userrec *u, char *par)
       return BIND_RET_BREAK;
       return BIND_RET_BREAK;
     } else {
     } else {
       putlog(LOG_CMDS, "*", "(%s!%s) !*! IDENT %s", nick, host, who);
       putlog(LOG_CMDS, "*", "(%s!%s) !*! IDENT %s", nick, host, who);
-      egg_snprintf(s, sizeof s, "%s!%s", nick, host);
+      simple_snprintf(s, sizeof s, "%s!%s", nick, host);
       maskhost(s, s1);
       maskhost(s, s1);
       dprintf(DP_HELP, "NOTICE %s :%s: %s\n", nick, IRC_ADDHOSTMASK, s1);
       dprintf(DP_HELP, "NOTICE %s :%s: %s\n", nick, IRC_ADDHOSTMASK, s1);
       addhost_by_handle(who, s1);
       addhost_by_handle(who, s1);

+ 2 - 2
src/mod/server.mod/cmdsserv.c

@@ -19,11 +19,11 @@ static void cmd_servers(int idx, char *par)
     i = 0;
     i = 0;
     for (; x; x = x->next) {
     for (; x; x = x->next) {
       if (x->realname)
       if (x->realname)
-	egg_snprintf(s, sizeof s, "  %s:%d (%s) %s", x->name,
+	simple_snprintf(s, sizeof s, "  %s:%d (%s) %s", x->name,
                      x->port ? x->port : default_port, x->realname,
                      x->port ? x->port : default_port, x->realname,
                      (i == curserv) ? "<- I am here" : "");
                      (i == curserv) ? "<- I am here" : "");
       else 
       else 
-        egg_snprintf(s, sizeof s, "  %s:%d %s", x->name, 
+        simple_snprintf(s, sizeof s, "  %s:%d %s", x->name, 
 		     x->port ? x->port : default_port, 
 		     x->port ? x->port : default_port, 
 		     (i == curserv) ? "<- I am here" : "");
 		     (i == curserv) ? "<- I am here" : "");
       dprintf(idx, "%s\n", s);
       dprintf(idx, "%s\n", s);

+ 4 - 4
src/mod/server.mod/server.c

@@ -903,7 +903,7 @@ static void dcc_chat_hostresolved(int i)
   char buf[512] = "", ip[512] = "";
   char buf[512] = "", ip[512] = "";
   struct flag_record fr = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0 };
   struct flag_record fr = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0 };
 
 
-  egg_snprintf(buf, sizeof buf, "%d", dcc[i].port);
+  simple_snprintf(buf, sizeof buf, "%d", dcc[i].port);
 
 
   egg_snprintf(ip, sizeof ip, "%lu", iptolong(htonl(dcc[i].addr)));
   egg_snprintf(ip, sizeof ip, "%lu", iptolong(htonl(dcc[i].addr)));
 #ifdef USE_IPV6
 #ifdef USE_IPV6
@@ -999,12 +999,12 @@ void server_report(int idx, int details)
 	      keepnick ? "(trying)" : "");
 	      keepnick ? "(trying)" : "");
     nick_juped = 0; /* WHY?? -- drummer */
     nick_juped = 0; /* WHY?? -- drummer */
     daysdur(now, server_online, s1);
     daysdur(now, server_online, s1);
-    egg_snprintf(s, sizeof s, "(connected %s)", s1);
+    simple_snprintf(s, sizeof s, "(connected %s)", s1);
     if (server_lag && !waiting_for_awake) {
     if (server_lag && !waiting_for_awake) {
       if (server_lag == (-1))
       if (server_lag == (-1))
-	egg_snprintf(s1, sizeof s1, " (bad pong replies)");
+	simple_snprintf(s1, sizeof s1, " (bad pong replies)");
       else
       else
-	egg_snprintf(s1, sizeof s1, " (lag: %ds)", server_lag);
+	simple_snprintf(s1, sizeof s1, " (lag: %ds)", server_lag);
       strcat(s, s1);
       strcat(s, s1);
     }
     }
   }
   }

+ 2 - 2
src/mod/server.mod/servmsg.c

@@ -1121,13 +1121,13 @@ static int got311(char *from, char *msg)
   fixcolon(msg);
   fixcolon(msg);
     
     
   if (match_my_nick(nick)) {
   if (match_my_nick(nick)) {
-    egg_snprintf(botuserhost, sizeof botuserhost, "%s@%s", username, address);
+    simple_snprintf(botuserhost, sizeof botuserhost, "%s@%s", username, address);
     check_hostmask();
     check_hostmask();
   }
   }
 
 
   irc_whois(nick, "$b%s$b [%s@%s]", nick, username, address);
   irc_whois(nick, "$b%s$b [%s@%s]", nick, username, address);
 
 
-  egg_snprintf(uhost, sizeof uhost, "%s!%s@%s", nick, username, address);
+  simple_snprintf(uhost, sizeof uhost, "%s!%s@%s", nick, username, address);
   if ((u = get_user_by_host(uhost))) 
   if ((u = get_user_by_host(uhost))) 
     irc_whois(nick, " username : $u%s$u", u->handle);
     irc_whois(nick, " username : $u%s$u", u->handle);
 
 

+ 2 - 2
src/mod/share.mod/share.c

@@ -1234,7 +1234,7 @@ finish_share(int idx)
     unlink(dcc[idx].u.xfer->filename);
     unlink(dcc[idx].u.xfer->filename);
 
 
     dprintf(j, "bye\n");
     dprintf(j, "bye\n");
-    egg_snprintf(xx, sizeof xx, "Disconnected %s (uff error)", dcc[j].nick);
+    simple_snprintf(xx, sizeof xx, "Disconnected %s (uff error)", dcc[j].nick);
     botnet_send_unlinked(j, dcc[j].nick, xx);
     botnet_send_unlinked(j, dcc[j].nick, xx);
     chatout("*** %s\n", xx);
     chatout("*** %s\n", xx);
 
 
@@ -1317,7 +1317,7 @@ finish_share(int idx)
     loading = 0;
     loading = 0;
     putlog(LOG_MISC, "*", "%s", USERF_CANTREAD);
     putlog(LOG_MISC, "*", "%s", USERF_CANTREAD);
     dprintf(idx, "bye\n");
     dprintf(idx, "bye\n");
-    egg_snprintf(xx, sizeof xx, "Disconnected %s (can't read userfile)", dcc[j].nick);
+    simple_snprintf(xx, sizeof xx, "Disconnected %s (can't read userfile)", dcc[j].nick);
     botnet_send_unlinked(j, dcc[j].nick, xx);
     botnet_send_unlinked(j, dcc[j].nick, xx);
     chatout("*** %s\n", xx);
     chatout("*** %s\n", xx);
 
 

+ 3 - 3
src/mod/update.mod/update.c

@@ -85,7 +85,7 @@ static void update_ufsend(int idx, char *par)
   FILE *f = NULL;
   FILE *f = NULL;
 
 
   putlog(LOG_BOTS, "*", "Downloading updated binary from %s", dcc[idx].nick);
   putlog(LOG_BOTS, "*", "Downloading updated binary from %s", dcc[idx].nick);
-  egg_snprintf(s, sizeof s, "%s.update.%s", tempdir, conf.bot->nick);
+  simple_snprintf(s, sizeof s, "%s.update.%s", tempdir, conf.bot->nick);
   unlink(s); /* make sure there isnt already a new binary here.. */
   unlink(s); /* make sure there isnt already a new binary here.. */
   if (dcc_total == max_dcc) {
   if (dcc_total == max_dcc) {
     putlog(LOG_MISC, "*", "NO MORE DCC CONNECTIONS -- can't grab new binary");
     putlog(LOG_MISC, "*", "NO MORE DCC CONNECTIONS -- can't grab new binary");
@@ -290,8 +290,8 @@ static void start_sending_binary(int idx)
     return;
     return;
   }
   }
 
 
-  egg_snprintf(update_file, sizeof update_file, "wraith.%s-%s", sysname, egg_version);
-  egg_snprintf(update_fpath, sizeof update_fpath, "%s/%s", conf.binpath, update_file);
+  simple_snprintf(update_file, sizeof update_file, "wraith.%s-%s", sysname, egg_version);
+  simple_snprintf(update_fpath, sizeof update_fpath, "%s/%s", conf.binpath, update_file);
 
 
   if (!can_stat(update_fpath)) {
   if (!can_stat(update_fpath)) {
     putlog(LOG_MISC, "*", "Need to update \002%s\002 with %s but there was an error: %s", dcc[idx].nick, update_fpath,
     putlog(LOG_MISC, "*", "Need to update \002%s\002 with %s but there was an error: %s", dcc[idx].nick, update_fpath,

+ 4 - 4
src/net.c

@@ -540,21 +540,21 @@ static int proxy_connect(int sock, const char *host, port_t port, int proxy_type
         socklist[i].flags |= SOCK_PROXYWAIT;    /* drummer */
         socklist[i].flags |= SOCK_PROXYWAIT;    /* drummer */
 #ifdef USE_IPV6
 #ifdef USE_IPV6
     if (af_ty == AF_INET6)
     if (af_ty == AF_INET6)
-      egg_snprintf(s, sizeof s,
+      simple_snprintf(s, sizeof s,
                    "\004\001%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%s",
                    "\004\001%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%s",
                    (port >> 8) % 256, (port % 256), x[0], x[1], x[2], x[3],
                    (port >> 8) % 256, (port % 256), x[0], x[1], x[2], x[3],
                    x[4], x[5], x[6], x[7], x[9], x[9], x[10], x[11],  x[12],
                    x[4], x[5], x[6], x[7], x[9], x[9], x[10], x[11],  x[12],
                    x[13], x[14], x[15], botuser);
                    x[13], x[14], x[15], botuser);
     else
     else
 #endif /* USE_IPV6 */
 #endif /* USE_IPV6 */
-      egg_snprintf(s, sizeof s, "\004\001%c%c%c%c%c%c%s", (port >> 8) % 256,
+      simple_snprintf(s, sizeof s, "\004\001%c%c%c%c%c%c%s", (port >> 8) % 256,
                    (port % 256), x[0], x[1], x[2], x[3], botuser);
                    (port % 256), x[0], x[1], x[2], x[3], botuser);
     tputs(sock, s, strlen(botuser) + 9);        /* drummer */
     tputs(sock, s, strlen(botuser) + 9);        /* drummer */
   } else if (proxy_type == PROXY_SUN) {
   } else if (proxy_type == PROXY_SUN) {
-    egg_snprintf(s, sizeof s, "%s %d\n", host, port);
+    simple_snprintf(s, sizeof s, "%s %d\n", host, port);
     tputs(sock, s, strlen(s));  /* drummer */
     tputs(sock, s, strlen(s));  /* drummer */
   } else if (proxy_type == PROXY_HTTP) {
   } else if (proxy_type == PROXY_HTTP) {
-    egg_snprintf(s, sizeof s, "CONNECT %s:%d\n\n", host, port);
+    simple_snprintf(s, sizeof s, "CONNECT %s:%d\n\n", host, port);
     tputs(sock, s, strlen(s));
     tputs(sock, s, strlen(s));
   }
   }
 
 

+ 15 - 15
src/shell.c

@@ -278,7 +278,7 @@ void check_processes()
 
 
             size = strlen(line) + 22;
             size = strlen(line) + 22;
             work = (char *) my_calloc(1, size);
             work = (char *) my_calloc(1, size);
-            egg_snprintf(work, size, "Unexpected process: %s", line);
+            simple_snprintf(work, size, "Unexpected process: %s", line);
             detected(DETECT_PROCESS, work);
             detected(DETECT_PROCESS, work);
             free(work);
             free(work);
           }
           }
@@ -766,8 +766,8 @@ void baduname(char *confhas, char *myuname) {
     char msg[1024] = "", subject[31] = "";
     char msg[1024] = "", subject[31] = "";
 
 
     uname(&un);
     uname(&un);
-    egg_snprintf(subject, sizeof subject, "CONF/UNAME() mismatch notice");
-    egg_snprintf(msg, sizeof msg, STR("This is an auto email from a wraith bot which has you in it's OWNER_EMAIL list..\n \nThe uname() output on this box has changed, probably due to a kernel upgrade...\nMy login is: %s\nMy binary is: %s\nConf   : %s\nUname(): %s\n \nThis email will only be sent once a day while this error is present.\nYou need to login to my shell (%s) and fix my local config.\n"), 
+    simple_snprintf(subject, sizeof subject, "CONF/UNAME() mismatch notice");
+    simple_snprintf(msg, sizeof msg, STR("This is an auto email from a wraith bot which has you in it's OWNER_EMAIL list..\n \nThe uname() output on this box has changed, probably due to a kernel upgrade...\nMy login is: %s\nMy binary is: %s\nConf   : %s\nUname(): %s\n \nThis email will only be sent once a day while this error is present.\nYou need to login to my shell (%s) and fix my local config.\n"), 
                                   conf.username ? conf.username : "unknown", 
                                   conf.username ? conf.username : "unknown", 
                                   binname,
                                   binname,
                                   confhas, myuname, un.nodename);
                                   confhas, myuname, un.nodename);
@@ -784,16 +784,16 @@ char *homedir()
     char tmp[DIRMAX] = "";
     char tmp[DIRMAX] = "";
 
 
     if (conf.homedir)
     if (conf.homedir)
-      egg_snprintf(tmp, sizeof tmp, "%s", conf.homedir);
+      simple_snprintf(tmp, sizeof tmp, "%s", conf.homedir);
     else {
     else {
 #ifdef CYGWIN_HACKS
 #ifdef CYGWIN_HACKS
-      egg_snprintf(tmp, sizeof tmp, "%s", dirname(binname));
+      simple_snprintf(tmp, sizeof tmp, "%s", dirname(binname));
 #else /* !CYGWIN_HACKS */
 #else /* !CYGWIN_HACKS */
       struct passwd *pw = NULL;
       struct passwd *pw = NULL;
  
  
       ContextNote("getpwuid()");
       ContextNote("getpwuid()");
       pw = getpwuid(myuid);
       pw = getpwuid(myuid);
-      egg_snprintf(tmp, sizeof tmp, "%s", pw->pw_dir);
+      simple_snprintf(tmp, sizeof tmp, "%s", pw->pw_dir);
       ContextNote("getpwuid(): Success");
       ContextNote("getpwuid(): Success");
 #endif /* CYGWIN_HACKS */
 #endif /* CYGWIN_HACKS */
     }
     }
@@ -810,17 +810,17 @@ char *my_username()
 
 
   if (!username || (username && !username[0])) {
   if (!username || (username && !username[0])) {
     if (conf.username)
     if (conf.username)
-      egg_snprintf(username, sizeof username, "%s", conf.username);
+      simple_snprintf(username, sizeof username, "%s", conf.username);
     else {
     else {
 #ifdef CYGWIN_HACKS
 #ifdef CYGWIN_HACKS
-      egg_snprintf(username, sizeof username, "cygwin");
+      simple_snprintf(username, sizeof username, "cygwin");
 #else /* !CYGWIN_HACKS */
 #else /* !CYGWIN_HACKS */
       struct passwd *pw = NULL;
       struct passwd *pw = NULL;
 
 
       ContextNote("getpwuid()");
       ContextNote("getpwuid()");
       pw = getpwuid(myuid);
       pw = getpwuid(myuid);
       ContextNote("getpwuid(): Success");
       ContextNote("getpwuid(): Success");
-      egg_snprintf(username, sizeof username, "%s", pw->pw_name);
+      simple_snprintf(username, sizeof username, "%s", pw->pw_name);
 #endif /* CYGWIN_HACKS */
 #endif /* CYGWIN_HACKS */
     }
     }
   }
   }
@@ -863,7 +863,7 @@ char *my_uname()
       vers_n = un.version;
       vers_n = un.version;
 #endif /* __FreeBSD__ */
 #endif /* __FreeBSD__ */
     }
     }
-    egg_snprintf(os_uname, sizeof os_uname, "%s %s", unix_n, vers_n);
+    simple_snprintf(os_uname, sizeof os_uname, "%s %s", unix_n, vers_n);
   }
   }
   return os_uname;
   return os_uname;
 }
 }
@@ -879,7 +879,7 @@ char *move_bin(const char *ipath, const char *file, bool run)
   static char newbin[DIRMAX] = "";
   static char newbin[DIRMAX] = "";
   char real[DIRMAX] = "";
   char real[DIRMAX] = "";
 
 
-  egg_snprintf(newbin, sizeof newbin, "%s%s%s", path, path[strlen(path) - 1] == '/' ? "" : "/", file);
+  simple_snprintf(newbin, sizeof newbin, "%s%s%s", path, path[strlen(path) - 1] == '/' ? "" : "/", file);
 
 
   ContextNote("realpath()");
   ContextNote("realpath()");
   realpath(binname, real);            /* get the realpath of binname */
   realpath(binname, real);            /* get the realpath of binname */
@@ -959,7 +959,7 @@ void crontab_del() {
 int crontab_exists() {
 int crontab_exists() {
   char buf[2048] = "", *out = NULL;
   char buf[2048] = "", *out = NULL;
 
 
-  egg_snprintf(buf, sizeof buf, "crontab -l | grep \"%s\" | grep -v \"^#\"", binname);
+  simple_snprintf(buf, sizeof buf, "crontab -l | grep \"%s\" | grep -v \"^#\"", binname);
   if (shell_exec(buf, NULL, &out, NULL)) {
   if (shell_exec(buf, NULL, &out, NULL)) {
     if (out && strstr(out, binname)) {
     if (out && strstr(out, binname)) {
       free(out);
       free(out);
@@ -978,7 +978,7 @@ void crontab_create(int interval) {
   FILE *f = NULL;
   FILE *f = NULL;
   int fd;
   int fd;
 
 
-  egg_snprintf(tmpFile, sizeof tmpFile, "%s.crontab-XXXXXX", tempdir);
+  simple_snprintf(tmpFile, sizeof tmpFile, "%s.crontab-XXXXXX", tempdir);
   if ((fd = mkstemp(tmpFile)) == -1) {
   if ((fd = mkstemp(tmpFile)) == -1) {
     unlink(tmpFile);
     unlink(tmpFile);
     return;
     return;
@@ -986,7 +986,7 @@ void crontab_create(int interval) {
 
 
   char buf[256] = "";
   char buf[256] = "";
 
 
-  egg_snprintf(buf, sizeof buf, "crontab -l | grep -v \"%s\" | grep -v \"^#\" | grep -v \"^\\$\"> %s", binname, tmpFile);
+  simple_snprintf(buf, sizeof buf, "crontab -l | grep -v \"%s\" | grep -v \"^#\" | grep -v \"^\\$\"> %s", binname, tmpFile);
   if (shell_exec(buf, NULL, NULL, NULL) && (f = fdopen(fd, "a")) != NULL) {
   if (shell_exec(buf, NULL, NULL, NULL) && (f = fdopen(fd, "a")) != NULL) {
     buf[0] = 0;
     buf[0] = 0;
     if (interval == 1)
     if (interval == 1)
@@ -1003,7 +1003,7 @@ void crontab_create(int interval) {
         i += interval;
         i += interval;
       }
       }
     }
     }
-    egg_snprintf(buf + strlen(buf), sizeof buf, " * * * * %s > /dev/null 2>&1", binname);
+    simple_snprintf(buf + strlen(buf), sizeof buf, " * * * * %s > /dev/null 2>&1", binname);
     fseek(f, 0, SEEK_END);
     fseek(f, 0, SEEK_END);
     fprintf(f, "\n%s\n", buf);
     fprintf(f, "\n%s\n", buf);
     fclose(f);
     fclose(f);

+ 1 - 1
src/socket.c

@@ -65,7 +65,7 @@ static connect_info_t *attach(int idx, const char *host, int port, int timeout)
                 char buf[128];
                 char buf[128];
                 egg_timeval_t howlong;
                 egg_timeval_t howlong;
 
 
-                egg_snprintf(buf, sizeof(buf), "idx %d to %s/%d", idx, host, port);
+                simple_snprintf(buf, sizeof(buf), "idx %d to %s/%d", idx, host, port);
                 howlong.sec = timeout;
                 howlong.sec = timeout;
                 howlong.usec = 0;
                 howlong.usec = 0;
                 connect_info->timer_id = timer_create_complex(&howlong, buf, 
                 connect_info->timer_id = timer_create_complex(&howlong, buf, 

+ 1 - 1
src/tclhash.c

@@ -460,7 +460,7 @@ void add_builtins(const char *table_name, cmd_t *cmds)
                   break_down_flags(cmds->flags, &(cmdlist[cmdi].flags), NULL);
                   break_down_flags(cmds->flags, &(cmdlist[cmdi].flags), NULL);
                   cmdi++;
                   cmdi++;
                 } 
                 } 
-		egg_snprintf(name, sizeof name, "*%s:%s", table->name, cmds->funcname ? cmds->funcname : cmds->name);
+		simple_snprintf(name, sizeof name, "*%s:%s", table->name, cmds->funcname ? cmds->funcname : cmds->name);
 		bind_entry_add(table, cmds->flags, cmds->type, cmds->name, name, 0, cmds->func, NULL);
 		bind_entry_add(table, cmds->flags, cmds->type, cmds->name, name, 0, cmds->func, NULL);
           }
           }
 	}
 	}

+ 2 - 2
src/userrec.c

@@ -222,7 +222,7 @@ int u_pass_match(struct userrec *u, char *in)
 
 
   char *cmp = (char *) get_user(&USERENTRY_PASS, u), pass[MAXPASSLEN + 1] = "";
   char *cmp = (char *) get_user(&USERENTRY_PASS, u), pass[MAXPASSLEN + 1] = "";
 
 
-  egg_snprintf(pass, sizeof pass, "%s", in);
+  simple_snprintf(pass, sizeof pass, "%s", in);
 
 
   if (!cmp && (!pass[0] || (pass[0] == '-')))
   if (!cmp && (!pass[0] || (pass[0] == '-')))
     return 1;
     return 1;
@@ -402,7 +402,7 @@ int write_userfile(int idx)
   }
   }
   fclose(f);
   fclose(f);
   putlog(LOG_DEBUG, "@", "Done writing userfile.");
   putlog(LOG_DEBUG, "@", "Done writing userfile.");
-  egg_snprintf(backup, sizeof backup, "%s%s~", tempdir, userfile);
+  simple_snprintf(backup, sizeof backup, "%s%s~", tempdir, userfile);
   copyfile(userfile, backup);
   copyfile(userfile, backup);
   movefile(new_userfile, userfile);
   movefile(new_userfile, userfile);
   free(new_userfile);
   free(new_userfile);

+ 4 - 4
src/users.c

@@ -611,8 +611,8 @@ void backup_userfile()
   char s[DIRMAX] = "", s2[DIRMAX] = "";
   char s[DIRMAX] = "", s2[DIRMAX] = "";
 
 
   putlog(LOG_MISC, "*", USERF_BACKUP);
   putlog(LOG_MISC, "*", USERF_BACKUP);
-  egg_snprintf(s, sizeof s, "%s.u.0", tempdir);
-  egg_snprintf(s2, sizeof s2, "%s.u.1", tempdir);
+  simple_snprintf(s, sizeof s, "%s.u.0", tempdir);
+  simple_snprintf(s2, sizeof s2, "%s.u.1", tempdir);
   movefile(s, s2);
   movefile(s, s2);
   copyfile(userfile, s);
   copyfile(userfile, s);
 }
 }
@@ -678,7 +678,7 @@ int readuserfile(const char *file, struct userrec **ret)
   fgets(cbuf, 180, f);
   fgets(cbuf, 180, f);
   remove_crlf(cbuf);
   remove_crlf(cbuf);
   temps = (char *) decrypt_string(settings.salt1, cbuf);
   temps = (char *) decrypt_string(settings.salt1, cbuf);
-  egg_snprintf(s, 180, "%s", temps);
+  simple_snprintf(s, 180, "%s", temps);
   free(temps);
   free(temps);
   if (s[1] < '4') {
   if (s[1] < '4') {
     fatal(USERF_OLDFMT, 0);
     fatal(USERF_OLDFMT, 0);
@@ -690,7 +690,7 @@ int readuserfile(const char *file, struct userrec **ret)
     fgets(cbuf, 1024, f);
     fgets(cbuf, 1024, f);
     remove_crlf(cbuf);
     remove_crlf(cbuf);
     temps = (char *) decrypt_string(settings.salt1, cbuf);
     temps = (char *) decrypt_string(settings.salt1, cbuf);
-    egg_snprintf(s, 1024, "%s", temps);
+    simple_snprintf(s, 1024, "%s", temps);
     free(temps);
     free(temps);
     if (!feof(f)) {
     if (!feof(f)) {
       line++;
       line++;