Jelajahi Sumber

* Cleanup all time_t warnings

svn: 3877
Bryan Drewery 18 tahun lalu
induk
melakukan
160a7c5103

+ 4 - 4
src/adns.c

@@ -134,7 +134,7 @@ interval_t async_server_timeout = 40;
 static void 
 dns_display(int idx, char *buf)
 {
-  sprintf(buf, "named   waited %lis", now - dcc[idx].timeval);
+  simple_sprintf(buf, "named   waited %ds", (int) (now - dcc[idx].timeval));
 }
 
 static void
@@ -192,7 +192,7 @@ static void eof_dcc_dnswait(int idx)
 
 static void display_dcc_dnswait(int idx, char *buf)
 {
-  sprintf(buf, "dns   waited %lis", now - dcc[idx].timeval);
+  simple_sprintf(buf, "dns   waited %ds", (int) (now - dcc[idx].timeval));
 }
 
 static void kill_dcc_dnswait(int idx, void *x)
@@ -966,13 +966,13 @@ void tell_dnsdebug(int idx)
 
 
 	for (q = query_head; q; q = q->next)
-		dprintf(idx, "DNS (%d) (%lis): %s\n", q->id, q->expiretime - now, q->query);
+		dprintf(idx, "DNS (%d) (%ds): %s\n", q->id, (int) (q->expiretime - now), q->query);
 
 //	for (i = 0; i < nhosts; i++)
 //           dprintf(idx, "HOST #%d: %s/%s\n", i, hosts[i].host, hosts[i].ip);
 
 	for (i = 0; i < ncache; i++) {
-		dprintf(idx, "cache(%d) %s expires in %lis\n", i, cache[i].query, cache[i].expiretime - now);
+		dprintf(idx, "cache(%d) %s expires in %ds\n", i, cache[i].query, (int) (cache[i].expiretime - now));
     		for (n = 0; n < cache[i].answer.len; n++)
 			dprintf(idx, "%d: %s\n", n, cache[i].answer.list[n]);
 	}

+ 1 - 1
src/auth.c

@@ -269,7 +269,7 @@ static int auth_tell_walk(const void *key, void *data, void *param)
 
 //  dprintf(idx, "%s(%s!%s) [%s] authtime: %li, atime: %li, Status: %d\n", auth->bd ? "x " : "", auth->nick, 
   dprintf(idx, "(%s!%s) [%s] authtime: %li, atime: %li, Status: %d\n", auth->nick, 
-        auth->host, auth->handle, auth->authtime, auth->atime, auth->Status());
+        auth->host, auth->handle, (long)auth->authtime, (long)auth->atime, auth->Status());
   
   return 0;
 }

+ 2 - 2
src/botcmd.c

@@ -780,8 +780,8 @@ static void bot_traced(int idx, char *par)
           timer_get_now(&tv);
           tm = ((tv.sec % 10000) * 100 + (tv.usec * 100) / (1000000)) - t;
 
-          dprintf(i, "%s -> %s (%li.%li secs, %d hop%s)\n", "Trace result", p2,
-            (tm / 100), (tm % 100), j, (j != 1) ? "s" : "");
+          dprintf(i, "%s -> %s (%d.%d secs, %d hop%s)\n", "Trace result", p2,
+            (int)(tm / 100), (int)(tm % 100), j, (j != 1) ? "s" : "");
 	} else
 	  dprintf(i, "%s -> %s\n", "Trace result", p);
       }

+ 2 - 2
src/chanprog.c

@@ -449,7 +449,7 @@ void load_internal_users()
             userlist = adduser(userlist, hand, "none", "-", USER_OP, 1);
             u = get_user_by_handle(userlist, hand);
 
-            egg_snprintf(tmp, sizeof(tmp), "%li [internal]", now);
+            egg_snprintf(tmp, sizeof(tmp), "%li [internal]", (long)now);
             set_user(&USERENTRY_ADDED, u, tmp);
 
             bi = (struct bot_addr *) my_calloc(1, sizeof(struct bot_addr));
@@ -506,7 +506,7 @@ void load_internal_users()
             userlist = adduser(userlist, hand, "none", "-", USER_ADMIN | USER_OWNER | USER_MASTER | USER_OP | USER_PARTY | USER_HUBA | USER_CHUBA, 0);
             u = get_user_by_handle(userlist, hand);
             set_user(&USERENTRY_PASS, u, pass);
-            egg_snprintf(tmp, sizeof(tmp), "%li [internal]", now);
+            egg_snprintf(tmp, sizeof(tmp), "%li [internal]", (long)now);
             set_user(&USERENTRY_ADDED, u, tmp);
             while (hosts) {
               char x[1024] = "";

+ 14 - 20
src/cmds.c

@@ -330,7 +330,7 @@ static void cmd_lagged(int idx, char *par)
   putlog(LOG_CMDS, "*", "#%s# lagged %s", dcc[idx].nick, par);
   for (int i = 0; i < dcc_total; i++) {
     if (dcc[i].type && dcc[i].type == &DCC_BOT) {
-      dprintf(idx, "%9s - %li seconds\n", dcc[i].nick, (dcc[i].pingtime > 120) ? (now - dcc[i].pingtime) : dcc[i].pingtime);
+      dprintf(idx, "%9s - %d seconds\n", dcc[i].nick, (dcc[i].pingtime > 120) ? (int) (now - dcc[i].pingtime) : (int) dcc[i].pingtime);
     }
   }
 }
@@ -370,7 +370,7 @@ static void cmd_motd(int idx, char *par)
     size = strlen(par) + 1 + strlen(dcc[idx].nick) + 10 + 1 + 1;
     s = (char *) my_calloc(1, size); /* +2: ' 'x2 */
 
-    egg_snprintf(s, size, "%s %li %s", dcc[idx].nick, now, par);
+    egg_snprintf(s, size, "%s %li %s", dcc[idx].nick, (long)now, par);
     var_set_by_name(NULL, "motd", s);
     free(s);
     dprintf(idx, "Motd set\n");
@@ -390,7 +390,7 @@ static void cmd_about(int idx, char *par)
   dprintf(idx, STR("http://wraith.botpack.net\n"));
   egg_strftime(c, sizeof c, "%c %Z", gmtime(&buildts));
   dprintf(idx, "Version: %s\n", egg_version);
-  dprintf(idx, "Build: %s (%li)\n", c, buildts);
+  dprintf(idx, "Build: %s (%li)\n", c, (long)buildts);
   dprintf(idx, "Revision: %d\n", revision);
   dprintf(idx, STR("(written from a base of Eggdrop 1.6.12)\n"));
   dprintf(idx, "..with credits and thanks to the following:\n");
@@ -1924,9 +1924,9 @@ static void cmd_debug(int idx, char *par)
   if (par[0])
     cmd = newsplit(&par);
   if (!cmd || (cmd && !strcmp(cmd, "timesync")))
-    dprintf(idx, "Timesync: %li (%li)\n", now + timesync, timesync);
+    dprintf(idx, "Timesync: %li (%li)\n", (long) (now + timesync), (long)timesync);
   if (!cmd || (cmd && !strcmp(cmd, "now")))
-    dprintf(idx, "Now: %li\n", now);
+    dprintf(idx, "Now: %li\n", (long)now);
   if (!cmd || (cmd && !strcmp(cmd, "role")))
     dprintf(idx, "Role: %d\n", role);
   if (!cmd || (cmd && !strcmp(cmd, "net")))
@@ -2122,13 +2122,11 @@ static void cmd_trace(int idx, char *par)
   putlog(LOG_CMDS, "*", "#%s# trace %s", dcc[idx].nick, par);
   simple_snprintf(x, sizeof(x), "%d:%s@%s", dcc[idx].sock, dcc[idx].nick, conf.bot->nick);
 
-  time_t tm;
   egg_timeval_t tv;
 
   timer_get_now(&tv);
-  tm = (tv.sec % 10000) * 100 + (tv.usec * 100) / (1000000);
 
-  sprintf(y, ":%li", tm);
+  egg_snprintf(y, sizeof(y), ":%li", (long) ((tv.sec % 10000) * 100 + (tv.usec * 100) / (1000000)));
   botnet_send_trace(i, x, par, y);
 }
 
@@ -3149,7 +3147,7 @@ static void cmd_newleaf(int idx, char *par)
     bi->hublevel = 999;
     set_user(&USERENTRY_BOTADDR, u1, bi);
     /* set_user(&USERENTRY_PASS, u1, settings.salt2); */
-    sprintf(tmp, "%li %s", now, dcc[idx].nick);
+    egg_snprintf(tmp, sizeof(tmp), "%li %s", (long) now, dcc[idx].nick);
     set_user(&USERENTRY_ADDED, u1, tmp);
     dprintf(idx, "Added new leaf: %s\n", handle);
     while (par[0]) {
@@ -3352,7 +3350,7 @@ static void cmd_pls_user(int idx, char *par)
 
     userlist = adduser(userlist, handle, phost, "-", USER_DEFAULT, 0);
     u2 = get_user_by_handle(userlist, handle);
-    sprintf(tmp, "%li %s", now, dcc[idx].nick);
+    egg_snprintf(tmp, sizeof(tmp), "%li %s", (long)now, dcc[idx].nick);
     set_user(&USERENTRY_ADDED, u2, tmp);
     dprintf(idx, "Added %s (%s) with no flags.\n", handle, phost);
     while (par[0]) {
@@ -3767,16 +3765,15 @@ static void cmd_timesync(int idx, char *par) {
   char tmp[30] = "";
 
   putlog(LOG_CMDS, "*", "#%s# timesync", dcc[idx].nick);
-  sprintf(tmp, "timesync %li", timesync + now);
+  egg_snprintf(tmp, sizeof(tmp), "timesync %li", (long)(timesync + now));
   botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, tmp);
 }
 
 static void rcmd_timesync(char *frombot, char *fromhand, char *fromidx, char *par) {
   char tmp[1024] = "";
-  time_t net;
+  long net = atol(par);
 
-  net = atol(par);
-  sprintf(tmp, "NET: %li    ME: %li   DIFF: %li", net, timesync + now, (timesync+now) - net);
+  sprintf(tmp, "NET: %li    ME: %li   DIFF: %d", net, (long)timesync + now, (int) ((timesync+now) - net));
   botnet_send_cmdreply(conf.bot->nick, frombot, fromhand, fromidx, tmp);
 }
 
@@ -3914,15 +3911,13 @@ static void rcmd_msg(char * tobot, char * frombot, char * fromhand, char * fromi
 
 /* netlag */
 static void cmd_netlag(int idx, char * par) {
-  time_t tm;
   egg_timeval_t tv;
   char tmp[64] = "";
 
   putlog(LOG_CMDS, "*", "#%s# netlag", dcc[idx].nick);
   
   timer_get_now(&tv);
-  tm = (tv.sec % 10000) * 100 + (tv.usec * 100) / (1000000);
-  sprintf(tmp, "ping %li", tm);
+  egg_snprintf(tmp, sizeof(tmp), "ping %li", (long) ((tv.sec % 10000) * 100 + (tv.usec * 100) / (1000000)));
   dprintf(idx, "Sent ping to all linked bots\n");
   botnet_send_cmd_broad(-1, conf.bot->nick, dcc[idx].nick, idx, tmp);
 }
@@ -3938,12 +3933,11 @@ static void rcmd_pong(char *frombot, char *fromhand, char *fromidx, char *par) {
   int i = atoi(fromidx);
 
   if ((i >= 0) && (i < dcc_total) && (dcc[i].type == &DCC_CHAT) && (!strcmp(dcc[i].nick, fromhand))) {
-    time_t tm;
     egg_timeval_t tv;
 
     timer_get_now(&tv);
-    tm = ((tv.sec % 10000) * 100 + (tv.usec * 100) / (1000000)) - atoi(par);
-    dprintf(i, "Pong from %s: %li.%li seconds\n", frombot, (tm / 100), (tm % 100));
+    long tm = ((tv.sec % 10000) * 100 + (tv.usec * 100) / (1000000)) - atol(par);
+    dprintf(i, "Pong from %s: %d.%d seconds\n", frombot, (int)(tm / 100), (int)(tm % 100));
   }
 }
 

+ 1 - 1
src/conf.c

@@ -1175,7 +1175,7 @@ void conf_add_userlist_bots()
         userlist = adduser(userlist, bot->nick, "none", "-", USER_OP, 1);
         u = get_user_by_handle(userlist, bot->nick);
 
-        egg_snprintf(tmp, sizeof(tmp), "%li [internal]", now);
+        egg_snprintf(tmp, sizeof(tmp), "%li [internal]", (long)now);
         set_user(&USERENTRY_ADDED, u, tmp);
 
         bi = (struct bot_addr *) my_calloc(1, sizeof(struct bot_addr));

+ 8 - 8
src/dcc.c

@@ -191,11 +191,11 @@ send_timesync(int idx)
 {
   /* Send timesync to idx, or all lower bots if idx<0 */
   if (idx >= 0)
-    dprintf(idx, "ts %li\n", timesync + now);
+    dprintf(idx, "ts %li\n", (long)(timesync + now));
   else {
     char s[15] = "";
 
-    sprintf(s, "ts %li\n", timesync + now);
+    egg_snprintf(s, sizeof(s), "ts %li\n", (long)(timesync + now));
     for (int i = 0; i < dcc_total; i++) {
       if (dcc[i].type && (dcc[i].type == &DCC_BOT) && (bot_aggressive_to(dcc[i].user))) {
         dprintf(i, s);
@@ -224,7 +224,7 @@ greet_new_bot(int idx)
     dcc[idx].status |= STAT_LEAF;
   dcc[idx].status |= STAT_LINKING;
 
-  dprintf(idx, "v 1001500 %d Wraith %s <%s> %d %li %d %s\n", HANDLEN, egg_version, "-", conf.bot->localhub, buildts, revision, egg_version);
+  dprintf(idx, "v 1001500 %d Wraith %s <%s> %d %li %d %s\n", HANDLEN, egg_version, "-", conf.bot->localhub, (long)buildts, revision, egg_version);
 
   for (int i = 0; i < dcc_total; i++) {
     if (dcc[i].type && dcc[i].type == &DCC_FORK_BOT) {
@@ -439,7 +439,7 @@ timeout_dcc_bot_new(int idx)
 static void
 display_dcc_bot_new(int idx, char *buf)
 {
-  sprintf(buf, "bot*  waited %lis", now - dcc[idx].timeval);
+  simple_sprintf(buf, "bot*  waited %ds", (int) (now - dcc[idx].timeval));
 }
 
 static void
@@ -745,7 +745,7 @@ tout_dcc_chat_secpass(int idx)
 static void
 display_dcc_chat_secpass(int idx, char *buf)
 {
-  sprintf(buf, "secpass  waited %lis", now - dcc[idx].timeval);
+  simple_sprintf(buf, "secpass  waited %ds", (int) (now - dcc[idx].timeval));
 }
 
 static void
@@ -759,7 +759,7 @@ tout_dcc_chat_pass(int idx)
 static void
 display_dcc_chat_pass(int idx, char *buf)
 {
-  sprintf(buf, "pass  waited %lis", now - dcc[idx].timeval);
+  simple_sprintf(buf, "pass  waited %ds", (int) (now - dcc[idx].timeval));
 }
 
 static void
@@ -1739,7 +1739,7 @@ timeout_dcc_telnet_id(int idx)
 static void
 display_dcc_telnet_id(int idx, char *buf)
 {
-  sprintf(buf, "t-in  waited %lis", now - dcc[idx].timeval);
+  simple_sprintf(buf, "t-in  waited %ds", (int) (now - dcc[idx].timeval));
 }
 
 struct dcc_table DCC_TELNET_ID = {
@@ -1811,7 +1811,7 @@ eof_dcc_identwait(int idx)
 static void
 display_dcc_identwait(int idx, char *buf)
 {
-  sprintf(buf, "idtw  waited %lis", now - dcc[idx].timeval);
+  simple_sprintf(buf, "idtw  waited %ds", (int) (now - dcc[idx].timeval));
 }
 
 struct dcc_table DCC_IDENTWAIT = {

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

@@ -528,7 +528,7 @@ static void cmd_slowjoin(int idx, char *par)
     return;
   }
 
-  egg_snprintf(buf, sizeof(buf), "+inactive addedby %s addedts %li", dcc[idx].nick, now);
+  egg_snprintf(buf, sizeof(buf), "+inactive addedby %s addedts %li", dcc[idx].nick, (long)now);
 
   if (par[0])
     strlcat(buf, par, sizeof(buf));
@@ -963,7 +963,7 @@ static void pls_chan(int idx, char *par, char *bot)
       if (!bot) {
         char tmp[51] = "";
 
-        sprintf(tmp, "addedby %s addedts %li", dcc[idx].nick, now);
+        egg_snprintf(tmp, sizeof(tmp), "addedby %s addedts %li", dcc[idx].nick, (long) now);
         if (buf[0]) {
           strcat(buf, " ");
           strcat(buf, tmp);

+ 35 - 35
src/mod/channels.mod/userchan.c

@@ -382,13 +382,13 @@ bool u_addmask(char type, struct chanset_t *chan, char *who, char *from, char *n
 
     if (mask) {
       if (!chan)
-	shareout("+m %c %s %lu %s%s %s %s\n",
-                 type, mask, expire_time - now,
+	shareout("+m %c %s %d %s%s %s %s\n",
+                 type, mask, (int) (expire_time - now),
 		 (flags & MASKREC_STICKY) ? "s" : "",
 		 (flags & MASKREC_PERM) ? "p" : "-", from, note);
       else
-	shareout("+mc %c %s %lu %s %s%s %s %s\n",
-		 type, mask, expire_time - now, chan->dname, 
+	shareout("+mc %c %s %d %s %s%s %s %s\n",
+		 type, mask, (int) (expire_time - now), chan->dname, 
                  (flags & MASKREC_STICKY) ? "s" : "",
 		 (flags & MASKREC_PERM) ? "p" : "-", from, note);
       free(mask);
@@ -578,9 +578,9 @@ bool write_bans(FILE *f, int idx)
   for (struct igrec *i = global_ign; i; i = i->next) {
     mask = str_escape(i->igmask, ':', '\\');
     if (!mask ||
-	lfprintf(f, "- %s:%s%lu:%s:%lu:%s\n", mask,
-		(i->flags & IGREC_PERM) ? "+" : "", i->expire,
-		i->user ? i->user : conf.bot->nick, i->added,
+	lfprintf(f, "- %s:%s%li:%s:%li:%s\n", mask,
+		(i->flags & IGREC_PERM) ? "+" : "", (long) i->expire,
+		i->user ? i->user : conf.bot->nick, (long) i->added,
 		i->msg ? i->msg : "") == EOF) {
       if (mask)
 	free(mask);
@@ -597,10 +597,10 @@ bool write_bans(FILE *f, int idx)
   for (b = global_bans; b; b = b->next) {
     mask = str_escape(b->mask, ':', '\\');
     if (!mask ||
-	lfprintf(f, "- %s:%s%lu%s:+%lu:%lu:%s:%s\n", mask,
-		(b->flags & MASKREC_PERM) ? "+" : "", b->expire,
-		(b->flags & MASKREC_STICKY) ? "*" : "", b->added,
-		b->lastactive, b->user ? b->user : conf.bot->nick,
+	lfprintf(f, "- %s:%s%li%s:+%li:%li:%s:%s\n", mask,
+		(b->flags & MASKREC_PERM) ? "+" : "", (long) b->expire,
+		(b->flags & MASKREC_STICKY) ? "*" : "", (long) b->added,
+		(long) b->lastactive, b->user ? b->user : conf.bot->nick,
 		b->desc ? b->desc : "requested") == EOF) {
       if (mask)
 	free(mask);
@@ -614,10 +614,10 @@ bool write_bans(FILE *f, int idx)
     for (b = chan->bans; b; b = b->next) {
       mask = str_escape(b->mask, ':', '\\');
       if (!mask ||
-        lfprintf(f, "- %s:%s%lu%s:+%lu:%lu:%s:%s\n", mask,
-	        (b->flags & MASKREC_PERM) ? "+" : "", b->expire,
-	        (b->flags & MASKREC_STICKY) ? "*" : "", b->added,
-	        b->lastactive, b->user ? b->user : conf.bot->nick,
+        lfprintf(f, "- %s:%s%li%s:+%li:%li:%s:%s\n", mask,
+	        (b->flags & MASKREC_PERM) ? "+" : "", (long) b->expire,
+	        (b->flags & MASKREC_STICKY) ? "*" : "", (long) b->added,
+	        (long) b->lastactive, b->user ? b->user : conf.bot->nick,
 	        b->desc ? b->desc : "requested") == EOF) {
           if (mask)
             free(mask);
@@ -642,10 +642,10 @@ bool write_exempts(FILE *f, int idx)
   for (e = global_exempts; e; e = e->next) {
     mask = str_escape(e->mask, ':', '\\');
     if (!mask ||
-        lfprintf(f, "%s %s:%s%lu%s:+%lu:%lu:%s:%s\n", "%", mask,
-		(e->flags & MASKREC_PERM) ? "+" : "", e->expire,
-		(e->flags & MASKREC_STICKY) ? "*" : "", e->added,
-		e->lastactive, e->user ? e->user : conf.bot->nick,
+        lfprintf(f, "%s %s:%s%li%s:+%li:%li:%s:%s\n", "%", mask,
+		(e->flags & MASKREC_PERM) ? "+" : "", (long) e->expire,
+		(e->flags & MASKREC_STICKY) ? "*" : "", (long) e->added,
+		(long) e->lastactive, e->user ? e->user : conf.bot->nick,
 		e->desc ? e->desc : "requested") == EOF) {
       if (mask)
 	free(mask);
@@ -659,10 +659,10 @@ bool write_exempts(FILE *f, int idx)
     for (e = chan->exempts; e; e = e->next) {
       mask = str_escape(e->mask, ':', '\\');
       if (!mask ||
-		lfprintf(f,"%s %s:%s%lu%s:+%lu:%lu:%s:%s\n","%", mask,
-		(e->flags & MASKREC_PERM) ? "+" : "", e->expire,
-		(e->flags & MASKREC_STICKY) ? "*" : "", e->added,
-		e->lastactive, e->user ? e->user : conf.bot->nick,
+		lfprintf(f,"%s %s:%s%li%s:+%li:%li:%s:%s\n","%", mask,
+		(e->flags & MASKREC_PERM) ? "+" : "", (long) e->expire,
+		(e->flags & MASKREC_STICKY) ? "*" : "", (long) e->added,
+		(long) e->lastactive, e->user ? e->user : conf.bot->nick,
 		e->desc ? e->desc : "requested") == EOF) {
         if (mask)
            free(mask);
@@ -689,10 +689,10 @@ bool write_invites(FILE *f, int idx)
   for (ir = global_invites; ir; ir = ir->next)  {
     mask = str_escape(ir->mask, ':', '\\');
     if (!mask ||
-	lfprintf(f,"@ %s:%s%lu%s:+%lu:%lu:%s:%s\n", mask,
-		(ir->flags & MASKREC_PERM) ? "+" : "", ir->expire,
-		(ir->flags & MASKREC_STICKY) ? "*" : "", ir->added,
-		ir->lastactive, ir->user ? ir->user : conf.bot->nick,
+	lfprintf(f,"@ %s:%s%li%s:+%li:%li:%s:%s\n", mask,
+		(ir->flags & MASKREC_PERM) ? "+" : "", (long) ir->expire,
+		(ir->flags & MASKREC_STICKY) ? "*" : "", (long) ir->added,
+		(long) ir->lastactive, ir->user ? ir->user : conf.bot->nick,
 		ir->desc ? ir->desc : "requested") == EOF) {
       if (mask)
 	free(mask);
@@ -706,10 +706,10 @@ bool write_invites(FILE *f, int idx)
     for (ir = chan->invites; ir; ir = ir->next) {
       mask = str_escape(ir->mask, ':', '\\');
       if (!mask ||
-	      lfprintf(f,"@ %s:%s%lu%s:+%lu:%lu:%s:%s\n", mask,
-		      (ir->flags & MASKREC_PERM) ? "+" : "", ir->expire,
-		      (ir->flags & MASKREC_STICKY) ? "*" : "", ir->added,
-		      ir->lastactive, ir->user ? ir->user : conf.bot->nick,
+	      lfprintf(f,"@ %s:%s%li%s:+%li:%li:%s:%s\n", mask,
+		      (ir->flags & MASKREC_PERM) ? "+" : "", (long) ir->expire,
+		      (ir->flags & MASKREC_STICKY) ? "*" : "", (long) ir->added,
+		      (long) ir->lastactive, ir->user ? ir->user : conf.bot->nick,
 		      ir->desc ? ir->desc : "requested") == EOF) {
         if (mask)
 	  free(mask);
@@ -746,7 +746,7 @@ bool write_chans(FILE *f, int idx)
       inactive = PLSMNS(channel_inactive(chan));
 
     if (lfprintf(f, "\
-+ channel add %s { chanmode { %s } addedby %s addedts %lu \
++ channel add %s { chanmode { %s } addedby %s addedts %li \
 bad-cookie %d manop %d mdop %d mop %d limit %d \
 flood-chan %d:%d flood-ctcp %d:%d flood-join %d:%d \
 flood-kick %d:%d flood-deop %d:%d flood-nick %d:%d flood-mjoin %d:%d \
@@ -760,7 +760,7 @@ flood-exempt %d flood-lock-time %d \
 	chan->dname,
 	w,
         chan->added_by,
-        chan->added_ts,
+        (long)chan->added_ts,
 /* Chanchar template
  *      temp,
  * also include temp %s in dprintf.
@@ -850,7 +850,7 @@ bool write_chans_compat(FILE *f, int idx)
       inactive = PLSMNS(channel_inactive(chan));
 
     if (lfprintf(f, "\
-+ channel add %s { chanmode { %s } addedby %s addedts %lu \
++ channel add %s { chanmode { %s } addedby %s addedts %li \
 bad-cookie %d manop %d mdop %d mop %d limit %d \
 flood-chan %d:%d flood-ctcp %d:%d flood-join %d:%d \
 flood-kick %d:%d flood-deop %d:%d flood-nick %d:%d \
@@ -863,7 +863,7 @@ exempt-time %d invite-time %d voice-non-ident %d auto-delay %d \
 	chan->dname,
 	w,
         chan->added_by,
-        chan->added_ts,
+        (long)chan->added_ts,
 /* Chanchar template
  *      temp,
  * also include temp %s in dprintf.

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

@@ -409,15 +409,15 @@ static void ctcp_minutely()
 
 static int ctcp_FINGER(char *nick, char *uhost, struct userrec *u, char *object, char *keyword, char *text)
 {
-  time_t idletime = 0;
+  int idletime = 0;
 
   if (cloak_awaytime)
     idletime = now - cloak_awaytime;
   else if (cloak_heretime)
     idletime = now - cloak_heretime;
-  dprintf(DP_HELP, "NOTICE %s :\001%s %s (%s@%s) Idle %li second%s\001\n", nick, keyword, "",
+  dprintf(DP_HELP, "NOTICE %s :\001%s %s (%s@%s) Idle %d second%s\001\n", nick, keyword, "",
                    conf.username ? conf.username : conf.bot->nick, 
-                   (strchr(botuserhost, '@') + 1), idletime, idletime == 1 ? "" : "s");
+                   (strchr(botuserhost, '@') + 1), (int) idletime, idletime == 1 ? "" : "s");
   return BIND_RET_BREAK;
 }
 

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

@@ -1571,11 +1571,11 @@ static void cmd_channel(int idx, char *par)
       } else {
 	/* Determine idle time */
 	if (now - (m->last) > 86400)
-	  egg_snprintf(s1, sizeof s1, "%2lid", ((now - (m->last)) / 86400));
+	  egg_snprintf(s1, sizeof s1, "%2dd", (int) ((now - (m->last)) / 86400));
 	else if (now - (m->last) > 3600)
-	  egg_snprintf(s1, sizeof s1, "%2lih", ((now - (m->last)) / 3600));
+	  egg_snprintf(s1, sizeof s1, "%2dh", (int) ((now - (m->last)) / 3600));
 	else if (now - (m->last) > 180)
-	  egg_snprintf(s1, sizeof s1, "%2lim", ((now - (m->last)) / 60));
+	  egg_snprintf(s1, sizeof s1, "%2dm", (int) ((now - (m->last)) / 60));
 	else
 	  strlcpy(s1, "   ", sizeof s1);
 	egg_snprintf(format, sizeof format, "%%c%%c%%-%us %%-%us %%s %%c   %%d %%s  %%s %%s\n", 
@@ -1751,7 +1751,7 @@ static void cmd_adduser(int idx, char *par)
   if (!u) {
     userlist = adduser(userlist, hand, p1, "-", USER_DEFAULT, 0);
     u = get_user_by_handle(userlist, hand);
-    sprintf(tmp, "%li %s", now, dcc[idx].nick);
+    egg_snprintf(tmp, sizeof(tmp), "%li %s", (long) now, dcc[idx].nick);
     set_user(&USERENTRY_ADDED, u, tmp);
     make_rand_str(s2, MAXPASSLEN);
     set_user(&USERENTRY_PASS, u, s2);

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

@@ -361,7 +361,7 @@ void makecookie(char *out, size_t len, const char *chname, const memberlist* opp
 
   make_rand_str(randstring, 4);
   /* &ts[4] is now last 6 digits of time */
-  egg_snprintf(ts, sizeof(ts), "%010li", now + timesync);
+  egg_snprintf(ts, sizeof(ts), "%010li", (long) (now + timesync));
   
   const char* hash1 = cookie_hash(chname, opper, m1, ts, randstring);
   const char* hash2 = m2 ? cookie_hash(chname, opper, m2, ts, randstring) : NULL;

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

@@ -957,7 +957,7 @@ static void server_secondly()
 static void server_check_lag()
 {
   if (server_online && !waiting_for_awake && !trying_server) {
-    dprintf(DP_DUMP, "PING :%li\n", now);
+    dprintf(DP_DUMP, "PING :%li\n", (long)now);
     lastpingtime = now;
     waiting_for_awake = 1;
   }

+ 1 - 1
src/mod/transfer.mod/transfer.c

@@ -602,7 +602,7 @@ void display_dcc_get(int idx, char *buf)
 
 void display_dcc_get_p(int idx, char *buf)
 {
-  sprintf(buf,"send  waited %lus\n    Filename: %s\n", now - dcc[idx].timeval, dcc[idx].u.xfer->origname);
+  simple_sprintf(buf,"send  waited %ds\n    Filename: %s\n", (int) (now - dcc[idx].timeval), dcc[idx].u.xfer->origname);
 }
 
 void display_dcc_send(int idx, char *buf)

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

@@ -376,7 +376,7 @@ static void check_updates()
       }
     }
     /* send out notice to update remote bots ... */
-    egg_snprintf(buf, sizeof buf, "nu? %lu %d", buildts, revision);
+    simple_snprintf(buf, sizeof buf, "nu? . %d", revision);
     putallbots(buf);
   }
 }

+ 2 - 2
src/userent.c

@@ -527,7 +527,7 @@ void update_mod(char *handle, char *nick, char *cmd, char *par)
 {
   char tmp[100] = "";
 
-  egg_snprintf(tmp, sizeof tmp, "%li, %s (%s %s)", now, nick, cmd, (par && par[0]) ? par : "");
+  egg_snprintf(tmp, sizeof tmp, "%li, %s (%s %s)", (long) now, nick, cmd, (par && par[0]) ? par : "");
   set_user(&USERENTRY_MODIFIED, get_user_by_handle(userlist, handle), tmp);
 }
 
@@ -697,7 +697,7 @@ static bool laston_write_userfile(FILE * f, struct userrec *u, struct user_entry
 {
   struct laston_info *li = (struct laston_info *) e->u.extra;
 
-  if (lfprintf(f, "--LASTON %lu %s\n", li->laston, li->lastonplace ? li->lastonplace : "") == EOF)
+  if (lfprintf(f, "--LASTON %li %s\n", (long) li->laston, li->lastonplace ? li->lastonplace : "") == EOF)
     return 0;
   return 1;
 }

+ 1 - 1
src/userrec.c

@@ -372,7 +372,7 @@ bool write_user(struct userrec *u, FILE * f, int idx)
       fr.match = FR_CHAN;
       fr.chan = ch->flags;
       build_flags(s, &fr, NULL);
-      if (lfprintf(f, "! %-20s %lu %-10s %s\n", ch->channel, ch->laston, s, ch->info ? ch->info : "") == EOF)
+      if (lfprintf(f, "! %-20s %li %-10s %s\n", ch->channel, (long) ch->laston, s, ch->info ? ch->info : "") == EOF)
         return 0;
     }
   }

+ 1 - 1
src/users.c

@@ -156,7 +156,7 @@ void addignore(char *ign, char *from, const char *mnote, time_t expire_time)
     char *mask = str_escape(ign, ':', '\\');
 
     if (mask) {
-      shareout("+i %s %li %c %s %s\n", mask, expire_time - now, (p->flags & IGREC_PERM) ? 'p' : '-', from, mnote);
+      shareout("+i %s %d %c %s %s\n", mask, (int) (expire_time - now), (p->flags & IGREC_PERM) ? 'p' : '-', from, mnote);
       free(mask);
     }
   }