From 37dc2e5f29031321ac768904286ccd389a87dd3d Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 11 Jan 2024 16:44:50 -0800 Subject: [PATCH 1/2] profile_t: calloc struct Avoids any string buffers not having a NUL byte at the end. --- src/k_profiles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_profiles.c b/src/k_profiles.c index 8dda612f4..2aa89d349 100644 --- a/src/k_profiles.c +++ b/src/k_profiles.c @@ -49,7 +49,7 @@ profile_t* PR_MakeProfile( INT32 controlarray[num_gamecontrols][MAXINPUTMAPPING], boolean guest) { - profile_t *new = Z_Malloc(sizeof(profile_t), PU_STATIC, NULL); + profile_t *new = Z_Calloc(sizeof(profile_t), PU_STATIC, NULL); new->version = PROFILEVER; @@ -351,7 +351,7 @@ void PR_LoadProfiles(void) for (i = 1; i < numprofiles; i++) { - profilesList[i] = Z_Malloc(sizeof(profile_t), PU_STATIC, NULL); + profilesList[i] = Z_Calloc(sizeof(profile_t), PU_STATIC, NULL); // Version. (We always update this on successful forward step) profilesList[i]->version = PROFILEVER; From 51ad284fef6fb83af196ef8bdf32d0310bdb1714 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 11 Jan 2024 16:48:22 -0800 Subject: [PATCH 2/2] Profiles: fix incorrect rumble setting for new profiles --- src/k_profiles.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/k_profiles.c b/src/k_profiles.c index 2aa89d349..a65da05cc 100644 --- a/src/k_profiles.c +++ b/src/k_profiles.c @@ -73,6 +73,7 @@ profile_t* PR_MakeProfile( new->kickstartaccel = false; new->autoroulette = false; new->litesteer = true; + new->rumble = true; // Copy from gamecontrol directly as we'll be setting controls up directly in the profile. memcpy(new->controls, controlarray, sizeof(new->controls));