Skip to content

Commit

Permalink
- Silence GCC warning in RTS_IsInitialized().
Browse files Browse the repository at this point in the history
/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);
      |                         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
  • Loading branch information
mjr4077au committed Jan 5, 2024
1 parent 91a05d0 commit ce03797
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/core/rts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ce03797

Please sign in to comment.