From 6e77b017c58cdcccfde45bfd72349ef9e7960f90 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Sat, 25 Feb 2017 14:24:43 -0600 Subject: [PATCH] Make comment consistent with code --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index 7eefc666..75de4e3c 100644 --- a/src/util.c +++ b/src/util.c @@ -52,7 +52,7 @@ FILE *fopen(const char *fname, const char *mode) { MultiByteToWideChar(CP_UTF8, 0, fname, -1, wfname, sz); sz = sizeof(wchar_t) * MultiByteToWideChar(CP_UTF8, 0, mode, -1, NULL, 0); - wchar_t *wmode = alloca(sz); // +2 is not needed, but just in case + wchar_t *wmode = alloca(sz + 2); // +2 is not needed, but just in case MultiByteToWideChar(CP_UTF8, 0, mode, -1, wmode, sz); return _wfopen(wfname, wmode); }