From 4695841b8dd218104970098b44844745ef3029be Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 14 Nov 2018 16:50:52 -0500 Subject: [PATCH] fix format-truncation: need bigger string buffers --- src/d_netfil.c | 2 +- src/d_netfil.h | 2 +- src/w_wad.h | 2 +- src/y_inter.c | 7 +++++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/d_netfil.c b/src/d_netfil.c index 6742cfe2..adbc8d77 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -94,7 +94,7 @@ static filetran_t transfer[MAXNETNODES]; // Receiver structure INT32 fileneedednum; // Number of files needed to join the server fileneeded_t fileneeded[MAX_WADFILES]; // List of needed files -char downloaddir[256] = "DOWNLOAD"; +char downloaddir[512] = "DOWNLOAD"; #ifdef CLIENT_LOADINGSCREEN // for cl loading screen diff --git a/src/d_netfil.h b/src/d_netfil.h index b9b7b2f2..a5a48fa0 100644 --- a/src/d_netfil.h +++ b/src/d_netfil.h @@ -48,7 +48,7 @@ typedef struct extern INT32 fileneedednum; extern fileneeded_t fileneeded[MAX_WADFILES]; -extern char downloaddir[256]; +extern char downloaddir[512]; #ifdef CLIENT_LOADINGSCREEN extern INT32 lastfilenum; diff --git a/src/w_wad.h b/src/w_wad.h index f7ea64a5..0e62cc9b 100644 --- a/src/w_wad.h +++ b/src/w_wad.h @@ -48,7 +48,7 @@ typedef struct // DYNAMIC WAD LOADING // ========================================================================= -#define MAX_WADPATH 128 +#define MAX_WADPATH 512 #define MAX_WADFILES 48 // maximum of wad files used at the same time // (there is a max of simultaneous open files anyway, and this should be plenty) diff --git a/src/y_inter.c b/src/y_inter.c index e7df165b..79d87f87 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1440,6 +1440,7 @@ static void Y_CalculateCompetitionWinners(void) UINT32 maxrings[MAXPLAYERS]; UINT32 monitors[MAXPLAYERS]; UINT32 scores[MAXPLAYERS]; + char tempname[9]; memset(data.competition.points, 0, sizeof (data.competition.points)); memset(points, 0, sizeof (points)); @@ -1531,8 +1532,9 @@ static void Y_CalculateCompetitionWinners(void) data.competition.monitors[data.competition.numplayers] = monitors[winner]; data.competition.scores[data.competition.numplayers] = scores[winner]; - snprintf(data.competition.name[data.competition.numplayers], 9, "%s", player_names[winner]); - data.competition.name[data.competition.numplayers][8] = '\0'; + strncpy(tempname, player_names[winner], 8); + tempname[8] = '\0'; + strncpy(data.competition.name[data.competition.numplayers], tempname, 9); data.competition.color[data.competition.numplayers] = &players[winner].skincolor; data.competition.character[data.competition.numplayers] = &players[winner].skin; @@ -1904,4 +1906,5 @@ static void Y_UnloadData(void) //are not handled break; } + }