- The big forward port. I probably broke lots of stuff, so please look over any
[ircu2.10.12-pk.git] / ircd / ircd_log.c
index bbc3e363640c837883984211bb8e1009fbc7827f..37e942bc8e77eb6b76203153393f7c540cdb5faa 100644 (file)
@@ -637,7 +637,8 @@ log_set_file(const char *subsys, const char *filename)
     desc->mark &= ~LOG_MARK_FILE; /* file has been reset to defaults */
 
   /* no change, don't go to the trouble of destroying and recreating */
-  if (desc->file && filename && !strcmp(desc->file->file, filename))
+  if (desc->file && desc->file->file && filename &&
+      !strcmp(desc->file->file, filename))
     return 0;
 
   /* debug log is special, since it has to be opened on fd 2 */
@@ -868,10 +869,12 @@ log_feature_report(struct Client *to, int flag)
 {
   int i;
 
-  for (i = 0; i < LS_LAST_SYSTEM; i++) {
+  for (i = 0; i < LS_LAST_SYSTEM; i++)
+  {
     if (logDesc[i].mark & LOG_MARK_FILE) /* report file */
       send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "F LOG %s FILE %s",
-                logDesc[i].name, logDesc[i].file->file);
+                 logDesc[i].name, (logDesc[i].file && logDesc[i].file->file ?
+                                   logDesc[i].file->file : "(terminal)"));
 
     if (logDesc[i].mark & LOG_MARK_FACILITY) /* report facility */
       send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "F LOG %s FACILITY %s",