gcontini
2019-12-01 b0c9c185f38c6bfc41a1d60e60aac1f7e79429dc
src/library/base/logger.c
@@ -4,8 +4,9 @@
#include <string.h>
#include <stdarg.h>
#include <time.h>
#include <unistd.h>
#ifdef __unix__
#include <unistd.h>
#define MAX_PATH 255
#else
#include <windows.h>
@@ -29,18 +30,18 @@
   if (folder == 0) {
      folder = "/tmp";
   }
   strcpy(logpath, folder);
   strcat(logpath, "/open-license.log");
   strncpy(logpath, folder, MAX_PATH);
   strncat(logpath, "/open-license.log", MAX_PATH - strlen(logpath));
#else
   int plen=GetTempPath(MAX_PATH,logpath);
   const int plen = GetTempPath(MAX_PATH, logpath);
   if(plen == 0) {
      fprintf(stderr, "Error getting temporary directory path");
   }
   strcat(logpath,"open-license.log");
   strncat(logpath, "open-license.log", MAX_PATH - strlen(logpath));
#endif
}
void _log(char* format, ...) {
void _log(const char* format, ...) {
   char logpath[MAX_PATH];
   va_list args;
   char * buffer;