From 5d9e4b31317e02432c1e7437f1b75f252f968a3e Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Fri, 8 Mar 2024 23:21:51 +0100 Subject: remove imspinner dep --- src/windows/main_windows.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/windows') 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); -- cgit v1.2.3-70-g09d2