Commit: 6c210c8ebe25bbe5d2842bb1ecca6f5063a46810
Parent: 58e8423b94062c549d70007d0982015d87294333
Author: Randy Palamar
Date: Thu, 13 Feb 2025 11:11:58 -0700
w32: read_file: don't shadow result
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/os_win32.c b/os_win32.c
@@ -164,8 +164,8 @@ os_read_file(Arena *a, char *file, size filesize)
s8 result = {0};
if (filesize > 0 && filesize <= (size)U32_MAX) {
- s8 result = s8alloc(a, filesize);
- iptr h = CreateFileA(file, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
+ result = s8alloc(a, filesize);
+ iptr h = CreateFileA(file, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
if (h >= 0) {
i32 rlen;
if (!ReadFile(h, result.data, result.len, &rlen, 0) || rlen != result.len) {