We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d4525f7 commit a29d838Copy full SHA for a29d838
src/Common/PlatformLinux.inl
@@ -87,16 +87,17 @@ inline void Sleep(int ms)
87
usleep(ms * 1000);
88
}
89
90
- #include <libgen.h>
+#include <libgen.h>
91
inline void _splitpath (
92
const char* path, // Path Input
93
char* drive, // Drive : Output
94
char* dir, // Directory : Output
95
char* fname, // Filename : Output
96
char* ext // Extension : Output
97
){
98
- char *tmp = NULL;
99
- tmp = realpath(path, NULL);
+ char tmp[PATH_MAX] = {0};
+ if(!realpath(path, tmp))
100
+ strcpy(tmp, path);
101
102
if(drive)
103
strcpy(drive, "");
@@ -109,8 +110,6 @@ inline void _splitpath (
109
110
111
if(fname)
112
strcpy(fname, basename(tmp));
-
113
- free(tmp);
114
115
116
#include <iostream>
0 commit comments