VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/libzip/zip_source_file_win32_utf16.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/libzip/zip_source_file_win32_utf16.c')
-rw-r--r--src/Common/libzip/zip_source_file_win32_utf16.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Common/libzip/zip_source_file_win32_utf16.c b/src/Common/libzip/zip_source_file_win32_utf16.c
index 08443d3d..8f07d021 100644
--- a/src/Common/libzip/zip_source_file_win32_utf16.c
+++ b/src/Common/libzip/zip_source_file_win32_utf16.c
@@ -39,6 +39,7 @@ static void utf16_make_tempname(char *buf, size_t len, const char *name, zip_uin
static char *utf16_strdup(const char *string);
/* clang-format off */
+DONT_WARN_INCOMPATIBLE_FN_PTR_BEGIN
zip_win32_file_operations_t ops_utf16 = {
utf16_allocate_tempname,
@@ -52,6 +53,7 @@ zip_win32_file_operations_t ops_utf16 = {
utf16_strdup
};
+DONT_WARN_INCOMPATIBLE_FN_PTR_END
/* clang-format on */
ZIP_EXTERN zip_source_t *
@@ -65,7 +67,7 @@ zip_source_win32w(zip_t *za, const wchar_t *fname, zip_uint64_t start, zip_int64
ZIP_EXTERN zip_source_t *
zip_source_win32w_create(const wchar_t *fname, zip_uint64_t start, zip_int64_t length, zip_error_t *error) {
- if (fname == NULL || length < -1) {
+ if (fname == NULL || length < ZIP_LENGTH_UNCHECKED) {
zip_error_set(error, ZIP_ER_INVAL, 0);
return NULL;
}
@@ -101,7 +103,7 @@ static HANDLE __stdcall utf16_create_file(const char *name, DWORD access, DWORD
static void
utf16_make_tempname(char *buf, size_t len, const char *name, zip_uint32_t i) {
- _snwprintf((wchar_t *)buf, len, L"%s.%08x", (const wchar_t *)name, i);
+ _snwprintf_s((wchar_t *)buf, len, len, L"%s.%08x", (const wchar_t *)name, i);
}