replaced strerror() with thread-safe strerror_malloc()
This commit is contained in:
@@ -37,7 +37,12 @@ Result(bool) dir_create(cstr path){
|
||||
if(mkdir(path, 0777) == -1)
|
||||
#endif
|
||||
{
|
||||
Return RESULT_ERROR_FMT("Can't create dicectory '%s': %s", path, strerror(errno));
|
||||
char* errno_s = strerror_malloc(errno);
|
||||
ResultVar(void) err = RESULT_ERROR_FMT(
|
||||
"Can't create dicectory '%s': %s",
|
||||
path, errno_s);
|
||||
free(errno_s);
|
||||
Return err;
|
||||
}
|
||||
|
||||
Return RESULT_VALUE(i, true);
|
||||
|
||||
Reference in New Issue
Block a user