Skip to content
Myr

Fix segmentation fault on Windows with long paths (fix #939)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Steven Penny · committed by David Tolnay · parent 91f0dcf · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:src/util.c+1 added-1 removed
45 unmodified lines
46#include "jv_alloc.h"4748#ifdef WIN3249FILE *fopen(const char *fname, const char *mode) {50 size_t sz = MultiByteToWideChar(CP_UTF8, 0, fname, -1, NULL, 0);50 size_t sz = sizeof(wchar_t) * MultiByteToWideChar(CP_UTF8, 0, fname, -1, NULL, 0);51 wchar_t *wfname = alloca(sz);52 MultiByteToWideChar(CP_UTF8, 0, fname, -1, wfname, sz);5354 sz = MultiByteToWideChar(CP_UTF8, 0, mode, -1, NULL, 0);
408 unmodified lines