summaryrefslogtreecommitdiffstats
path: root/utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utf8.c b/utf8.c
index 99e21978..a65c864e 100644
--- a/utf8.c
+++ b/utf8.c
@@ -376,7 +376,7 @@ FILE *w_freopen(const wchar_t *wname, const wchar_t *wmode, FILE *fold)
{
char *name = utf8_dup_to(wname);
char *mode = utf8_dup_to(wmode);
- FILE *f = freopen(name, mode, fold);
+ FILE *f = fold ? freopen(name, mode, fold) : fopen(name, mode);
free(name);
free(mode);
return f;