Mercurial > hg > openttd
changeset 14525:9843e2e409f4 draft
(svn r19096) -Fix: segfault when one of the items in the news_display group in the config file has no value
author | yexo <yexo@openttd.org> |
---|---|
date | Thu, 11 Feb 2010 15:12:08 +0000 |
parents | 02ddea71c644 |
children | 860154474401 |
files | src/settings.cpp |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/settings.cpp +++ b/src/settings.cpp @@ -1133,14 +1133,17 @@ 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; } }