fix format-truncation: need bigger string buffers

This commit is contained in:
Alam Ed Arias 2018-11-14 16:50:52 -05:00
parent fb08950c19
commit 4695841b8d
4 changed files with 8 additions and 5 deletions

View file

@ -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

View file

@ -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;

View file

@ -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)

View file

@ -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;
}
}