diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-03-08 23:21:51 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-03-08 23:21:51 +0100 |
| commit | 5d9e4b31317e02432c1e7437f1b75f252f968a3e (patch) | |
| tree | 54031a80ea3e5b3654ed74bfd1474edd9409f989 /src/windows | |
| parent | 15dd612705a2054cacfb794f5d1662f38316bbdd (diff) | |
remove imspinner dep
Diffstat (limited to 'src/windows')
| -rw-r--r-- | src/windows/main_windows.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/windows/main_windows.cpp b/src/windows/main_windows.cpp index cb59d9d..74c1e86 100644 --- a/src/windows/main_windows.cpp +++ b/src/windows/main_windows.cpp @@ -241,9 +241,11 @@ ts_file_content ts_platform_read_file(char *path, const char *mode) const size_t cSize = strlen(mode)+1; wchar_t* wc = new wchar_t[cSize]; - mbstowcs (wc, mode, cSize); + size_t outSize; + mbstowcs_s(&outSize, wc, cSize, mode, cSize); - FILE *file = _wfopen(wchar_buffer, wc); + FILE *file; + _wfopen_s(&file, wchar_buffer, wc); if (!file) { if (errno == EMFILE) @@ -281,7 +283,7 @@ ts_file_content ts_platform_read_file(char *path, const char *mode) if (!result.content) goto done; memset(result.content, 0, length); - int read_result = fread(result.content, 1, length, file); + size_t read_result = fread(result.content, 1, length, file); if (read_result == 0 && length != 0) { free(result.content); |
