From 5f48b749acc525051cd66db71159c39ecf0f985b Mon Sep 17 00:00:00 2001 From: JusticarProgramming Date: Thu, 27 Aug 2026 23:48:44 +0200 Subject: [PATCH] Fix the save loading bug that corrupts saves --- code/savever.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/savever.cpp b/code/savever.cpp index 223e101..9ac6033 100644 --- a/code/savever.cpp +++ b/code/savever.cpp @@ -658,9 +658,9 @@ HRESULT SaveVersionInfo::Load_String(IStorage *storage, int id, char *string) return(res); } + WCHAR buf[128]; int i = 0; - while (true) { - WCHAR buf[128]; + while (i < ARRAY_SIZE(buf) - 1) { res = stm->Read(&buf[i], sizeof(buf[i]), NULL); if (FAILED(res)) { return(res);