From 4b144193504cec483e81d54cd167b98c5c9e0b87 Mon Sep 17 00:00:00 2001 From: superp00t Date: Sun, 30 Mar 2025 23:31:38 -0400 Subject: [PATCH] fix(file): where recursive CreateDirectory under Windows always reports an out-of-bounds error for no reason --- bc/system/file/win/Stacked.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bc/system/file/win/Stacked.cpp b/bc/system/file/win/Stacked.cpp index 5a2d34a..1a52add 100644 --- a/bc/system/file/win/Stacked.cpp +++ b/bc/system/file/win/Stacked.cpp @@ -504,7 +504,7 @@ bool CreateDirectory(FileParms* parms) { s++; } - if (Blizzard::String::Copy(leadingpath, path, std::min(static_cast(s - path) + 2, MAX_PATH))) { + if (Blizzard::String::Copy(leadingpath, path, std::min(static_cast(s - path) + 2, MAX_PATH)) >= MAX_PATH) { BC_FILE_SET_ERROR(8); if (path != pathbuffer) { delete path;