write_string_to_file would try to write the error message that it failed to open a file stream to the very same file stream it just tried to open.
Fix this by writing to stderr instead.
This commit is contained in:
hesiod 2017-05-30 17:17:51 +03:00 коммит произвёл GitHub
Родитель 20f7314881
Коммит ba381580af
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -192,7 +192,7 @@ static bool write_string_to_file(const char *path, const char *string)
FILE *file = fopen(path, "w");
if (!file)
{
fprintf(file, "Failed to write file: %s\n", path);
fprintf(stderr, "Failed to write file: %s\n", path);
return false;
}