mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Fix assertion error due to too long filenames
This commit is contained in:
@@ -173,7 +173,15 @@ void LoadSaveScreenEntry()
|
||||
vfs::CVirtualProfile* prof = it.value();
|
||||
memset(&FileInfo, 0, sizeof(GETFILESTRUCT));
|
||||
strcpy(FileInfo.zFileName, "< ");
|
||||
strcat(FileInfo.zFileName, prof->cName.utf8().c_str());
|
||||
// Cut filename off if it's too long for the buffer
|
||||
if (strlen(prof->cName.utf8().c_str()) > FILENAME_BUFLEN-4)
|
||||
{
|
||||
strncpy(FileInfo.zFileName+1, prof->cName.utf8().c_str(), FILENAME_BUFLEN-4);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat(FileInfo.zFileName, prof->cName.utf8().c_str());
|
||||
}
|
||||
strcat(FileInfo.zFileName, " >");
|
||||
FileInfo.zFileName[FILENAME_BUFLEN] = 0;
|
||||
FileInfo.uiFileAttribs = FILE_IS_DIRECTORY;
|
||||
|
||||
Reference in New Issue
Block a user