replaced strerror() with thread-safe strerror_malloc()

This commit is contained in:
2025-11-21 13:15:17 +05:00
parent 225a48a8d9
commit 0b4574b53e
8 changed files with 62 additions and 22 deletions

View File

@@ -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);