Skip to content
  • Alan Coopersmith's avatar
    WriteSave: allocate enough room for full session_save_file in error · 416a3fc8
    Alan Coopersmith authored
    
    
    Clears warning from gcc 11.2:
    
    saveutil.c: In function ‘WriteSave’:
    saveutil.c:315:75: warning: ‘%s’ directive output may be truncated
     writing up to 1023 bytes into a region of size 221 [-Wformat-truncation=]
      315 |         snprintf (msg, sizeof(msg), "%s: Error creating session save file %s",
          |                                                                           ^~
      316 |                   Argv[0], session_save_file);
          |                            ~~~~~~~~~~~~~~~~~
    saveutil.c:315:9: note: ‘snprintf’ output 36 or more bytes (assuming 1059)
     into a destination of size 256
      315 |         snprintf (msg, sizeof(msg), "%s: Error creating session save file %s",
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      316 |                   Argv[0], session_save_file);
          |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Signed-off-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
    416a3fc8