mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-18 15:11:51 +00:00
- fixed stale pointer access in Unix version of D_AddFile.
Pointer was assigned a buffer of a local variable that went out of scope before checking its content. Fixes #268 (hopefully)
This commit is contained in:
parent
a46792e519
commit
4c915180da
1 changed files with 1 additions and 1 deletions
|
@ -208,10 +208,10 @@ bool D_AddFile(TArray<FString>& wadfiles, const char* file, bool check, int posi
|
|||
// Confirm file exists in filesystem.
|
||||
struct stat info;
|
||||
bool found = stat(file, &info) == 0;
|
||||
FString fullpath = file;
|
||||
if (!found)
|
||||
{
|
||||
// File not found, so split file into path and filename so we can enumerate the path for the file.
|
||||
FString fullpath = file;
|
||||
auto lastindex = fullpath.LastIndexOf("/");
|
||||
FString basepath = fullpath.Left(lastindex);
|
||||
FString filename = fullpath.Right(fullpath.Len() - lastindex - 1);
|
||||
|
|
Loading…
Reference in a new issue