tCode added to replace any NULL pointers in the game configuration with much sa… | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit c7c22dcbc04447fdb9b26fdcab29ede8c9db8946 | |
parent c2cfbe10fcf5b737df5017c00a47c19ded54016d | |
Author: Ben Webb <[email protected]> | |
Date: Mon, 8 Jul 2002 12:47:35 +0000 | |
Code added to replace any NULL pointers in the game configuration with much | |
safer null strings. | |
Diffstat: | |
M src/dopewars.c | 7 +++++++ | |
1 file changed, 7 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/src/dopewars.c b/src/dopewars.c | |
t@@ -2350,6 +2350,13 @@ void SetupParameters(void) | |
AssignName(&StoppedTo[i], _(DefaultStoppedTo[i])); | |
} | |
+ /* Replace nasty null pointers with null strings */ | |
+ for (i = 0; i < NUMGLOB; ++i) { | |
+ if (Globals[i].StringVal && !*Globals[i].StringVal) { | |
+ *Globals[i].StringVal = g_strdup(""); | |
+ } | |
+ } | |
+ | |
/* Now read in the global configuration file */ | |
conf = GetGlobalConfigFile(); | |
if (conf) { |