fix(file): where recursive CreateDirectory under Windows always reports an out-of-bounds error for no reason

This commit is contained in:
phaneron 2025-03-30 23:31:38 -04:00
parent e813ad0672
commit 4b14419350

View file

@ -504,7 +504,7 @@ bool CreateDirectory(FileParms* parms) {
s++;
}
if (Blizzard::String::Copy(leadingpath, path, std::min(static_cast<int32_t>(s - path) + 2, MAX_PATH))) {
if (Blizzard::String::Copy(leadingpath, path, std::min(static_cast<int32_t>(s - path) + 2, MAX_PATH)) >= MAX_PATH) {
BC_FILE_SET_ERROR(8);
if (path != pathbuffer) {
delete path;