diff options
author | Filip Gawin <filip.gawin@zoho.com> | 2020-07-26 00:11:13 +0200 |
---|---|---|
committer | Filip Gawin <filip.gawin@zoho.com> | 2020-07-26 00:11:13 +0200 |
commit | 98ec7bdaf9047a16a27048202bcebf3fc1ef97d2 (patch) | |
tree | 09c2861d9179fb8df15b693e9635dec821bf6515 /src/fakerw/fake.cpp | |
parent | 40c09d28f7491d158a8b8a81806d4b84cdf0e031 (diff) |
Provide more memory for casepath's arg
Diffstat (limited to 'src/fakerw/fake.cpp')
-rw-r--r-- | src/fakerw/fake.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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 |