From 98ec7bdaf9047a16a27048202bcebf3fc1ef97d2 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Sun, 26 Jul 2020 00:11:13 +0200 Subject: Provide more memory for casepath's arg --- src/fakerw/fake.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/fakerw/fake.cpp') diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp index 6524e87c..d4417a7f 100644 --- a/src/fakerw/fake.cpp +++ b/src/fakerw/fake.cpp @@ -379,7 +379,7 @@ RwStream *RwStreamOpen(RwStreamType type, RwStreamAccessType accessType, const v FILE* first = fopen((char*)pData, "r"); char *r; if (!first) { - r = (char*)alloca(strlen((char*)pData) + 2); + r = (char*)alloca(strlen((char*)pData) + 4); // Use default path(and pass error handling to librw) if we can't find any match if (!casepath((char*)pData, r)) r = (char*)pData; @@ -862,7 +862,7 @@ RtBMPImageWrite(RwImage *image, const RwChar *imageName) char *r = nil; FILE *valid = fopen((char *)imageName, "r"); if(!valid) { - char *r = (char *)alloca(strlen((char *)imageName) + 2); + char *r = (char *)alloca(strlen((char *)imageName) + 4); // Use default path(and pass error handling to librw) if we can't find any match if(!casepath((char *)imageName, r)) r = (char *)imageName; } else @@ -880,7 +880,7 @@ RtBMPImageRead(const RwChar *imageName) char *r = nil; FILE *valid = fopen((char *)imageName, "r"); if(!valid) { - r = (char *)alloca(strlen((char *)imageName) + 2); + r = (char *)alloca(strlen((char *)imageName) + 4); // Use default path(and pass error handling to librw) if we can't find any match if(!casepath((char *)imageName, r)) r = (char *)imageName; } else -- cgit v1.2.3