mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
Fix infinite loop in OSD_StripColors() when trying to display a quote containing '^' not followed by a number.
This fixes Mission 2 of Platoon Leader, as reported by RunningDuke. git-svn-id: https://svn.eduke32.com/eduke32@6478 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
486791b3ee
commit
2c7840d928
1 changed files with 9 additions and 2 deletions
|
@ -146,14 +146,21 @@ const char * OSD_StripColors(char *outBuf, const char *inBuf)
|
|||
if (*inBuf == '^')
|
||||
{
|
||||
if (isdigit(*(inBuf+1)))
|
||||
{
|
||||
inBuf += 2 + !!isdigit(*(inBuf+2));
|
||||
else if ((Btoupper(*(inBuf+1)) == 'O'))
|
||||
inBuf += 2;
|
||||
else if ((Btoupper(*(inBuf+1)) == 'S') && isdigit(*(inBuf+2)))
|
||||
inBuf += 3;
|
||||
|
||||
continue;
|
||||
}
|
||||
else if ((Btoupper(*(inBuf+1)) == 'O'))
|
||||
{
|
||||
inBuf += 2;
|
||||
continue;
|
||||
}
|
||||
else if ((Btoupper(*(inBuf+1)) == 'S') && isdigit(*(inBuf+2)))
|
||||
{
|
||||
inBuf += 3;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
*(outBuf++) = *(inBuf++);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue