mirror of
https://github.com/GTAmodding/re3.git
synced 2025-10-11 13:10:34 +00:00
Provide more memory for casepath's arg
This commit is contained in:
parent
40c09d28f7
commit
98ec7bdaf9
4 changed files with 8 additions and 8 deletions
|
@ -189,7 +189,7 @@ GetGTA3ImgSize(void)
|
|||
realpath(gImgNames[0], path);
|
||||
if (stat(path, &statbuf) == -1) {
|
||||
// Try case-insensitivity
|
||||
char *r = (char*)alloca(strlen(gImgNames[0]) + 2);
|
||||
char *r = (char*)alloca(strlen(gImgNames[0]) + 4);
|
||||
if (casepath(gImgNames[0], r))
|
||||
{
|
||||
realpath(r, path);
|
||||
|
@ -460,7 +460,7 @@ CdStreamAddImage(char const *path)
|
|||
|
||||
// Fix case sensitivity and backslashes.
|
||||
if (gImgFiles[gNumImages] == -1) {
|
||||
char *r = (char*)alloca(strlen(path) + 2);
|
||||
char *r = (char*)alloca(strlen(path) + 4);
|
||||
if (casepath(path, r))
|
||||
{
|
||||
gImgFiles[gNumImages] = open(r, _gdwCdStreamFlags);
|
||||
|
|
|
@ -37,7 +37,7 @@ static myFILE myfiles[NUMFILES];
|
|||
// Case-insensitivity on linux (from https://github.com/OneSadCookie/fcaseopen)
|
||||
void mychdir(char const *path)
|
||||
{
|
||||
char *r = (char*)alloca(strlen(path) + 2);
|
||||
char *r = (char*)alloca(strlen(path) + 4);
|
||||
if (casepath(path, r))
|
||||
{
|
||||
chdir(r);
|
||||
|
@ -88,7 +88,7 @@ found:
|
|||
// Be case-insensitive on linux (from https://github.com/OneSadCookie/fcaseopen/)
|
||||
#if !defined(_WIN32)
|
||||
if (!myfiles[fd].file) {
|
||||
char *r = (char*)alloca(strlen(newPath) + 2);
|
||||
char *r = (char*)alloca(strlen(newPath) + 4);
|
||||
if (casepath(newPath, r))
|
||||
{
|
||||
myfiles[fd].file = fopen(r, realmode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue