Procházet zdrojové kódy

* cmd_date had some broken strings

svn: 458
Bryan Drewery před 22 roky
rodič
revize
85a85c89c9
1 změnil soubory, kde provedl 4 přidání a 2 odebrání
  1. 4 2
      src/cmds.c

+ 4 - 2
src/cmds.c

@@ -1329,20 +1329,22 @@ static void cmd_console(struct userrec *u, int idx, char *par)
   }
 }
 
+void test_colors(int);
 static void cmd_date(struct userrec *u, int idx, char *par)
 {
   char date[50], utctime[50], ltime[50];
+  ltime[0] = utctime[0] = 0;
   putlog(LOG_CMDS, "*", "#%s# date", dcc[idx].nick);
   egg_strftime(date, sizeof date, "%c %Z", localtime(&now));
 #ifndef S_UTCTIME
   sprintf(ltime, "<-- This time is used on the bot.");
 #endif /* !S_UTCTIME */
-  dprintf(idx, "%s %s\n", date, ltime[0] ? ltime : "");
+  dprintf(idx, "%s %s\n", date, (ltime && ltime[0]) ? ltime : "");
   egg_strftime(date, sizeof date, "%c %Z", gmtime(&now));
 #ifdef S_UTCTIME
   sprintf(utctime, "<-- This time is used on the bot.");
 #endif /* S_UTCTIME */
-  dprintf(idx, "%s %s\n", date, utctime[0] ? utctime : "");
+  dprintf(idx, "%s %s\n", date, (utctime && utctime[0]) ? utctime : "");
 }
 
 #ifdef HUB