From 99127c1833cd36d30187f77eabdc2bb0e8dc891a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Raes?= Date: Sun, 24 Sep 2023 14:03:10 +0200 Subject: [PATCH] refactor: initialize bufferSize on declaration Co-authored-by: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> --- NorthstarDLL/mods/autodownload/moddownloader.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/NorthstarDLL/mods/autodownload/moddownloader.cpp b/NorthstarDLL/mods/autodownload/moddownloader.cpp index 25a4d866f..0cec8f32d 100644 --- a/NorthstarDLL/mods/autodownload/moddownloader.cpp +++ b/NorthstarDLL/mods/autodownload/moddownloader.cpp @@ -358,7 +358,7 @@ void ModDownloader::ExtractMod(fs::path modPath) } // Create file - int bufferSize; + int bufferSize = 8192; void* buffer; int err = UNZ_OK; FILE* fout = NULL; @@ -380,7 +380,6 @@ void ModDownloader::ExtractMod(fs::path modPath) } // Allocate memory for buffer - bufferSize = 8192; buffer = (void*)malloc(bufferSize); if (buffer == NULL) {