Skip to content
  • Philipp Kutin's avatar
    duke32: in savegame.cpp, use Bstrncpyz() for copying from/to '_savehead::boardfn'. · 778901d0
    Philipp Kutin authored
    With 'RELEASE := 0', gcc (Raspbian 8.3.0-6+rpi1) 8.3.0 said:
    
     savegame.cpp: In function 'int32_t G_LoadPlayer(savebrief_t&)':
     savegame.cpp:655:12: warning: 'void* memcpy(void*, const void*, size_t)' offset [297, 328]
       from the object at 'h' is out of the bounds of referenced subobject '_savehead::boardfn'
       with type 'char [224]' at offset 72 [-Warray-bounds]
          Bmemcpy(boardfilename, h.boardfn, sizeof(boardfilename));
    
    It also emits many warnings about possible truncation with (B)snprintf(),
    presumably based on computed upper bounds on the length of the input varargs.
    
    Also, resurrect static assert for post-commit-687000e2 situation and
    remove comment referencing a tag which was removed in commit bd3a933a.
    778901d0