mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Fix a small buffer overflow when disabling shuffle playback
Repeat 10 times: - strcat() is evil - strcat() is evil ... While here fix another small inconsistency: Vorbis playback should stop when switching 'shuffle' on. The overflow was reported by @tomgreen66 in pull request #168.
This commit is contained in:
parent
c07fe5ac2d
commit
af957c5e36
1 changed files with 3 additions and 5 deletions
|
@ -1137,7 +1137,6 @@ CDShuffleFunc(void *unused)
|
|||
if (ogg->value)
|
||||
{
|
||||
OGG_ParseCmd("?");
|
||||
OGG_Stop();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1146,11 +1145,10 @@ CDShuffleFunc(void *unused)
|
|||
|
||||
if (ogg->value)
|
||||
{
|
||||
if ((int)strtol(cl.configstrings[CS_CDTRACK], (char **)NULL,
|
||||
10) < 10)
|
||||
if ((int)strtol(cl.configstrings[CS_CDTRACK], (char **)NULL, 10) < 10)
|
||||
{
|
||||
char tmp[2] = "0";
|
||||
OGG_ParseCmd(strcat(tmp, cl.configstrings[CS_CDTRACK]));
|
||||
char tmp[3] = {'0', cl.configstrings[CS_CDTRACK][0], '\0'};
|
||||
OGG_ParseCmd(tmp);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue