diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 740edbf..f11f059 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -423,7 +423,11 @@ else() endif() set(SAFETY_FLAGS "-fwrapv -fno-fast-math") - set(SAFETY_LDFLAGS "-Wl,-z,relro,-z,now") + if(MINGW) + set(SAFETY_LDFLAGS "") + else() + set(SAFETY_LDFLAGS "-Wl,-z,relro,-z,now") + endif() set(OPT_FLAGS "-O3 -fomit-frame-pointer") set(OPT_LDFLAGS "-Wl,-O1,--sort-common,-s") diff --git a/src/path.c b/src/path.c index 89daa67..f5ea557 100644 --- a/src/path.c +++ b/src/path.c @@ -266,14 +266,14 @@ int path_init() } for (k=0; k<2; k++) { for (i--; i>=0; i--) { - if (path[i] == '/') + if (buff[i] == '/') break; } - path[i] = 0; + buff[i] = 0; } path.cwd = strdup(buff); - path.data_global = strdup(cwd); + path.data_global = strdup(path.cwd); path.home = strdup(path.cwd); path.data_user = path_set(path.cwd,"data",NULL,0); path.config = strdup(path.cwd);