- Silence GCC warning in RTS_IsInitialized().

/home/mrichters/Repos/Raze/source/core/rts.cpp: In function ‘bool RTS_IsInitialized()’:
/home/mrichters/Repos/Raze/source/core/rts.cpp:123:51: warning: ‘.rts’ directive output may be truncated writing 4 bytes into a region of size between 3 and 11 [-Wformat-truncation=]
  123 |                         snprintf(rts, 16, "rts%02d.rts", i);
      |                                                   ^~~~
/home/mrichters/Repos/Raze/source/core/rts.cpp:123:33: note: ‘snprintf’ output between 10 and 18 bytes into a destination of size 16
  123 |                         snprintf(rts, 16, "rts%02d.rts", i);
      |                         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
Mitchell Richters 2024-01-06 09:32:13 +11:00
parent 91a05d01d2
commit ce03797949

View file

@ -119,8 +119,8 @@ bool RTS_IsInitialized()
{
if (li.size > 0)
{
char rts[16];
snprintf(rts, 16, "rts%02d.rts", i);
char rts[18];
snprintf(rts, 18, "rts%02d.rts", i);
int lump = fileSystem.AddFromBuffer(rts, (char*)RTSFile.Data() + li.position, li.size, -1, 0);
li.sid = soundEngine->AddSoundLump(rts, lump, 0, -1);
}