Changeset - r14515:bfe76f78ba51
[Not reviewed]
master
0 1 0
yexo - 15 years ago 2010-02-11 15:12:08
yexo@openttd.org
(svn r19096) -Fix: segfault when one of the items in the news_display group in the config file has no value
1 file changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/settings.cpp
Show inline comments
 
@@ -1133,14 +1133,17 @@ static void NewsDisplayLoadConfig(IniFil
 
			continue;
 
		}
 

	
 
		if (strcasecmp(item->value, "full") == 0) {
 
		if (StrEmpty(item->value)) {
 
			DEBUG(misc, 0, "Empty display value for newstype %s", item->name);
 
			continue;
 
		} else if (strcasecmp(item->value, "full") == 0) {
 
			_news_type_data[news_item].display = ND_FULL;
 
		} else if (strcasecmp(item->value, "off") == 0) {
 
			_news_type_data[news_item].display = ND_OFF;
 
		} else if (strcasecmp(item->value, "summarized") == 0) {
 
			_news_type_data[news_item].display = ND_SUMMARY;
 
		} else {
 
			DEBUG(misc, 0, "Invalid display value: %s", item->value);
 
			DEBUG(misc, 0, "Invalid display value for newstype %s: %s", item->name, item->value);
 
			continue;
 
		}
 
	}
0 comments (0 inline, 0 general)