From 964e16a506c35e0f3bf6eba8a03ce800f928ce68 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Tue, 9 Apr 2013 17:35:17 +0000 Subject: [PATCH] Silence "may be used uninitialized" warning, use Batoi() for user input. Nag: The behavoir of atoi() is *undefined* if "the value of the result cannot be represented" (C99 7.20.1). Note: my nagging about undefined behaviors will *not* get less over time. :P git-svn-id: https://svn.eduke32.com/eduke32@3660 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/game.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 6a8a673dc..16998efe2 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -8777,7 +8777,7 @@ static void G_CheckCommandLine(int32_t argc, const char **argv) { if (argc > i+1) { - g_usingAddon = atoi(argv[i+1]); + g_usingAddon = Batoi(argv[i+1]); if (g_usingAddon > ADDON_NONE && g_usingAddon < NUMADDONS) g_noSetup = 1; @@ -10122,7 +10122,7 @@ void G_MaybeAllocPlayer(int32_t pnum) void G_LoadAddon(void) { struct grpfile * grp; - int32_t crc; + int32_t crc = 0; // compiler-happy switch (g_usingAddon) {