mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-24 05:01:40 +00:00
Fix running if built on OS X 10.9
strncpy with in == out causes signal 6 if built on OS X 10.9. (If built on older OS X versions, the game works on 10.9 though.) It was happening in COM_StripExtension during map load.
This commit is contained in:
parent
7672533e8f
commit
fd4cd6612d
1 changed files with 5 additions and 1 deletions
|
@ -76,8 +76,12 @@ COM_StripExtension
|
|||
void COM_StripExtension( const char *in, char *out, int destsize )
|
||||
{
|
||||
const char *dot = strrchr(in, '.'), *slash;
|
||||
|
||||
if (dot && (!(slash = strrchr(in, '/')) || slash < dot))
|
||||
Q_strncpyz(out, in, (destsize < dot-in+1 ? destsize : dot-in+1));
|
||||
destsize = (destsize < dot-in+1 ? destsize : dot-in+1);
|
||||
|
||||
if ( in == out && destsize > 1 )
|
||||
out[destsize-1] = '\0';
|
||||
else
|
||||
Q_strncpyz(out, in, destsize);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue