fix undefined behaviours and jpeg crash on non-windows platforms

This commit is contained in:
nillerusr
2023-10-08 07:31:07 +03:00
parent 047f8b1185
commit 5a4d0b7a4d
4 changed files with 10 additions and 4 deletions

View File

@@ -1500,6 +1500,9 @@ void FileOpenDialog::OnOpen()
char pFileName[MAX_PATH];
GetSelectedFileName( pFileName, sizeof( pFileName ) );
if( !pFileName[0] )
return;
int nLen = Q_strlen( pFileName );
bool bSpecifiedDirectory = ( pFileName[nLen-1] == '/' || pFileName[nLen-1] == '\\' ) && (!IsOSX() || ( IsOSX() && !Q_stristr( pFileName, ".app" ) ) );
Q_StripTrailingSlash( pFileName );