From 8dd6fe5d29d448ec654b70a7fee61047d51db0ac Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 10 Dec 2024 10:11:53 -0500 Subject: Fix widening conversions after arithmetic --- src/win32/environment_win32.c | 2 +- src/win32/filesystem_win32.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/win32') diff --git a/src/win32/environment_win32.c b/src/win32/environment_win32.c index e7a0ee3..64feee5 100644 --- a/src/win32/environment_win32.c +++ b/src/win32/environment_win32.c @@ -14,7 +14,7 @@ zix_expand_environment_strings(ZixAllocator* const allocator, return NULL; } - char* const out = (char*)zix_calloc(allocator, 1U, size + 1U); + char* const out = (char*)zix_calloc(allocator, (size_t)size + 1U, 1U); if (out) { ExpandEnvironmentStrings(string, out, size + 1U); } diff --git a/src/win32/filesystem_win32.c b/src/win32/filesystem_win32.c index a790264..877e717 100644 --- a/src/win32/filesystem_win32.c +++ b/src/win32/filesystem_win32.c @@ -1,4 +1,4 @@ -// Copyright 2007-2022 David Robillard +// Copyright 2007-2024 David Robillard // SPDX-License-Identifier: ISC #include @@ -205,7 +205,7 @@ zix_canonical_path(ZixAllocator* const allocator, const char* const path) return NULL; } - char* const final = (char*)zix_calloc(allocator, final_size + 1U, 1U); + char* const final = (char*)zix_calloc(allocator, (size_t)final_size + 1U, 1U); if (!final || !GetFinalPathNameByHandle(h, final, final_size + 1U, flags)) { zix_free(allocator, final); CloseHandle(h); -- cgit v1.2.1