From 7d2ab461d9820c5f42d1d9ddaad564bcab1789c6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 6 Apr 2015 20:59:43 +0200 Subject: [PATCH] - don't use 'countof' to iterate through a static array that's defined inside a function. Some GCC versions apparently do not like that. --- src/gameconfigfile.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gameconfigfile.cpp b/src/gameconfigfile.cpp index 112bcbe1b3..a168579a0f 100644 --- a/src/gameconfigfile.cpp +++ b/src/gameconfigfile.cpp @@ -433,6 +433,7 @@ void FGameConfigFile::DoKeySetup(const char *gamename) { "Bindings", &Bindings }, { "DoubleBindings", &DoubleBindings }, { "AutomapBindings", &AutomapBindings }, + NULL, NULL }; const char *key, *value; @@ -442,7 +443,7 @@ void FGameConfigFile::DoKeySetup(const char *gamename) C_SetDefaultBindings (); - for (int i = 0; i < countof(binders); ++i) + for (int i = 0; binders[i].label != NULL; ++i) { strncpy(subsection, binders[i].label, sublen); if (SetSection(section))