Resize downloaddir to fix -Wformat-truncation

This commit is contained in:
James R 2023-01-05 04:02:46 -08:00
parent dfd8a36f8f
commit e78625455e
3 changed files with 4 additions and 3 deletions

View file

@ -139,6 +139,7 @@ char srb2path[256] = ".";
boolean usehome = true;
const char *pandf = "%s" PATHSEP "%s";
static char addonsdir[MAX_WADPATH];
char downloaddir[sizeof addonsdir + sizeof DOWNLOADDIR_PART] = "DOWNLOAD";
//
// EVENT HANDLING
@ -1361,7 +1362,7 @@ void D_SRB2Main(void)
/* and downloads in a subdirectory */
snprintf(downloaddir, sizeof downloaddir, "%s%s%s",
addonsdir, PATHSEP, "downloads");
addonsdir, PATHSEP, DOWNLOADDIR_PART);
// rand() needs seeded regardless of password
srand((unsigned int)time(NULL));

View file

@ -99,7 +99,6 @@ static filetran_t transfer[MAXNETNODES];
INT32 fileneedednum; // Number of files needed to join the server
fileneeded_t fileneeded[MAX_WADFILES]; // List of needed files
static tic_t lasttimeackpacketsent = 0;
char downloaddir[512] = "DOWNLOAD";
// For resuming failed downloads
typedef struct

View file

@ -62,7 +62,8 @@ struct fileneeded_t
extern INT32 fileneedednum;
extern fileneeded_t fileneeded[MAX_WADFILES];
extern char downloaddir[512];
#define DOWNLOADDIR_PART "downloads"
extern char downloaddir[];
extern INT32 lastfilenum;
extern INT32 downloadcompletednum;