]> Shamusworld >> Repos - stargem2/blobdiff - src/log.cpp
Finally fixed problems with demo mode.
[stargem2] / src / log.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 236d563..67a1dea
@@ -1,18 +1,22 @@
 //
 // Log handler
 //
-// by James L. Hammons
+// by James Hammons
+// (C) 2022 Underground Software
 //
 
-#include "types.h"
 #include "log.h"
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+
 #define MAX_LOG_SIZE           10000000                                // Maximum size of log file (10 MB)
 
 static FILE * log_stream = NULL;
-static uint32 logSize = 0;
+static uint32_t logSize = 0;
 
-bool InitLog(char * path)
+bool InitLog(const char * path)
 {
        log_stream = fopen(path, "wrt");
 
@@ -46,8 +50,8 @@ void WriteLog(const char * text, ...)
        {
                fflush(log_stream);
                fclose(log_stream);
-               exit(1);
-       }//*/
+               log_stream = NULL;
+       }
 
        va_end(arg);
        fflush(log_stream);                                     // Make sure that text is written!