fix fs_os_get_temp_path for windows

This commit is contained in:
lixianjing 2020-12-19 16:55:58 +08:00
parent 733be1ef42
commit a0900c023f

View File

@ -15,6 +15,7 @@
#include <io.h>
#include <direct.h>
#include <Shlobj.h>
#include <fileapi.h>
#define unlink _unlink
#define rename MoveFileA
#define ftruncate _chsize
@ -449,7 +450,7 @@ static ret_t fs_os_get_temp_path(fs_t* fs, char path[MAX_PATH + 1]) {
return RET_OK;
#elif defined(WIN32)
WCHAR tempdir[MAX_PATH + 1];
DWORD ret = GetTempPathW(tempdir, MAX_PATH);
DWORD ret = GetTempPathW(MAX_PATH, tempdir);
str_t str;
str_init(&str, MAX_PATH);
str_from_wstr(&str, tempdir);