mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-02-05 03:34:25 +00:00
crtlib: fix undefined behaviour when stripping extenstion from empty string
This commit is contained in:
parent
d2157fa28c
commit
5884cf88d3
@ -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--;
|
||||
|
Loading…
x
Reference in New Issue
Block a user