From 74288a4de1ad52cc8b88560b0a0052962bba0432 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 3 Dec 2021 14:59:22 -0800 Subject: [PATCH] Fix compiling errors - Replace itoa with sprintf (itoa is a nonstandard function). - Guard one instance of Discord Rich Presence. --- src/k_menudef.c | 2 ++ src/k_menufunc.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/k_menudef.c b/src/k_menudef.c index 0e2e26111..9754ae366 100644 --- a/src/k_menudef.c +++ b/src/k_menudef.c @@ -1009,8 +1009,10 @@ menu_t OPTIONS_DataScreenshotDef = { menuitem_t OPTIONS_DataReplay[] = { +#ifdef HAVE_DISCORDRPC {IT_STRING | IT_CVAR, "Rich Presence", "Allow Discord to display game info on your status.", NULL, &cv_discordrp, 0, 0}, +#endif {IT_STRING | IT_CVAR, "Synch. Check Interval", "How often to check for synchronization while playing back a replay.", NULL, &cv_netdemosyncquality, 0, 0}, diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 7adff19d6..902a38d33 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -2243,7 +2243,7 @@ static void M_MPConfirmCharacterSelection(void) // colour // (convert the number that's saved to a string we can use) col = setup_player[i].color; - itoa(col, colstr, 10); + sprintf(colstr, "%d", col); strcpy(cmd, commandnames[i][1]); strcat(cmd, colstr); @@ -4033,4 +4033,4 @@ void M_Manual(INT32 choice) MISC_ManualDef.prevMenu = (choice == INT32_MAX ? NULL : currentMenu); M_SetupNextMenu(&MISC_ManualDef, true); -} \ No newline at end of file +}