summaryrefslogtreecommitdiffstats
path: root/src/win32
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-12-10 10:11:53 -0500
committerDavid Robillard <d@drobilla.net>2024-12-11 00:19:20 -0500
commit8dd6fe5d29d448ec654b70a7fee61047d51db0ac (patch)
tree55d3646daa583d3130c653fcc29d709f3d8ca601 /src/win32
parent1e2f1466262ef571764bec2b95e466763d468ae3 (diff)
downloadzix-8dd6fe5d29d448ec654b70a7fee61047d51db0ac.tar.gz
zix-8dd6fe5d29d448ec654b70a7fee61047d51db0ac.tar.bz2
zix-8dd6fe5d29d448ec654b70a7fee61047d51db0ac.zip
Fix widening conversions after arithmetic
Diffstat (limited to 'src/win32')
-rw-r--r--src/win32/environment_win32.c2
-rw-r--r--src/win32/filesystem_win32.c4
2 files changed, 3 insertions, 3 deletions
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 <d@drobilla.net>
+// Copyright 2007-2024 David Robillard <d@drobilla.net>
// SPDX-License-Identifier: ISC
#include <zix/filesystem.h>
@@ -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);