Bryan Drewery 21 سال پیش
والد
کامیت
98e5da8596
3فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 1 1
      src/log.c
  2. 1 1
      src/main.c
  3. 3 1
      src/misc_file.c

+ 1 - 1
src/log.c

@@ -161,7 +161,7 @@ void putlog(int type, const char *chname, const char *format, ...)
   int idx = 0;
   char out[LOGLINEMAX + 1] = "";
 
-  if (conf.bot->hub) {
+  if (conf.bot && conf.bot->hub) {
     char stamp[34] = "";
     struct tm *t = gmtime(&now);
 

+ 1 - 1
src/main.c

@@ -148,7 +148,7 @@ static char *getfullbinname(const char *argv_zero)
 
 void fatal(const char *s, int recoverable)
 {
-  if (conf && !conf.bot->hub)
+  if (conf.bot && !conf.bot->hub)
     nuke_server((char *) s);
 
   if (s && s[0])

+ 3 - 1
src/misc_file.c

@@ -173,8 +173,10 @@ Tempfile::Tempfile(const char *prefix)
 
 void Tempfile::MakeTemp()
 {
-  if ((fd = mkstemp(file)) < 0)
+  if ((fd = mkstemp(file)) < 0) {
+    f = NULL;
     goto error;    
+  }
 
   if ((f = fdopen(fd, "w+b")) == NULL)
     goto error;