mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
crtlib: fix undefined behaviour when stripping extenstion from empty string
This commit is contained in:
@@ -858,7 +858,11 @@ void COM_StripExtension( char *path )
|
||||
{
|
||||
size_t length;
|
||||
|
||||
length = Q_strlen( path ) - 1;
|
||||
length = Q_strlen( path );
|
||||
|
||||
if( length > 0 )
|
||||
length--;
|
||||
|
||||
while( length > 0 && path[length] != '.' )
|
||||
{
|
||||
length--;
|
||||
|
||||
Reference in New Issue
Block a user