diff --git a/mongoose.c b/mongoose.c index e009bd2e..c1ce1b59 100644 --- a/mongoose.c +++ b/mongoose.c @@ -1186,7 +1186,7 @@ static int p_stat(const char *path, size_t *size, time_t *mtime) { #else #if MG_ARCH == MG_ARCH_WIN32 struct _stati64 st; - wchar_t tmp[PATH_MAX]; + wchar_t tmp[MG_PATH_MAX]; MultiByteToWideChar(CP_UTF8, 0, path, -1, tmp, sizeof(tmp) / sizeof(tmp[0])); if (_wstati64(tmp, &st) != 0) return 0; #else @@ -1327,7 +1327,7 @@ static void p_list(const char *dir, void (*fn)(const char *, void *), static void *p_open(const char *path, int flags) { const char *mode = flags == MG_FS_READ ? "rb" : "a+b"; #if MG_ARCH == MG_ARCH_WIN32 - wchar_t b1[PATH_MAX], b2[10]; + wchar_t b1[MG_PATH_MAX], b2[10]; MultiByteToWideChar(CP_UTF8, 0, path, -1, b1, sizeof(b1) / sizeof(b1[0])); MultiByteToWideChar(CP_UTF8, 0, mode, -1, b2, sizeof(b2) / sizeof(b2[0])); return (void *) _wfopen(b1, b2); diff --git a/src/fs_posix.c b/src/fs_posix.c index 968b7a48..aa804d30 100644 --- a/src/fs_posix.c +++ b/src/fs_posix.c @@ -17,7 +17,7 @@ static int p_stat(const char *path, size_t *size, time_t *mtime) { #else #if MG_ARCH == MG_ARCH_WIN32 struct _stati64 st; - wchar_t tmp[PATH_MAX]; + wchar_t tmp[MG_PATH_MAX]; MultiByteToWideChar(CP_UTF8, 0, path, -1, tmp, sizeof(tmp) / sizeof(tmp[0])); if (_wstati64(tmp, &st) != 0) return 0; #else @@ -158,7 +158,7 @@ static void p_list(const char *dir, void (*fn)(const char *, void *), static void *p_open(const char *path, int flags) { const char *mode = flags == MG_FS_READ ? "rb" : "a+b"; #if MG_ARCH == MG_ARCH_WIN32 - wchar_t b1[PATH_MAX], b2[10]; + wchar_t b1[MG_PATH_MAX], b2[10]; MultiByteToWideChar(CP_UTF8, 0, path, -1, b1, sizeof(b1) / sizeof(b1[0])); MultiByteToWideChar(CP_UTF8, 0, mode, -1, b2, sizeof(b2) / sizeof(b2[0])); return (void *) _wfopen(b1, b2);