tCode added to replace any NULL pointers in the game configuration with much safer null strings. - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit c7c22dcbc04447fdb9b26fdcab29ede8c9db8946
(DIR) parent c2cfbe10fcf5b737df5017c00a47c19ded54016d
(HTM) Author: Ben Webb <ben@salilab.org>
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(-)
---
(DIR) 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) {