summaryrefslogtreecommitdiff
path: root/src/settings_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-10 08:58:52 +0000
committerrubidium <rubidium@openttd.org>2008-05-10 08:58:52 +0000
commitf23026cce8fa49974e3dd06e00dd073cb45f906b (patch)
tree746df1921c03a63762ea8a5c0a05a16d672c34fe /src/settings_gui.cpp
parente099831210a55f71f7def91d2ee9fb6c3058a1eb (diff)
downloadopenttd-f23026cce8fa49974e3dd06e00dd073cb45f906b.tar.xz
(svn r13027) -Codechange: use StrEmpty instead of arr[0] == '\0' and remove the need for WE_ON_EDIT_TEXT_CANCEL.
Diffstat (limited to 'src/settings_gui.cpp')
-rw-r--r--src/settings_gui.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 5145644f6..887690e8a 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -1059,7 +1059,7 @@ static void PatchesSelectionWndProc(Window *w, WindowEvent *e)
break;
case WE_ON_EDIT_TEXT:
- if (e->we.edittext.str != NULL) {
+ if (!StrEmpty(e->we.edittext.str)) {
const PatchEntry *pe = &_patches_page[WP(w, def_d).data_1].entries[WP(w, def_d).data_3];
const SettingDesc *sd = pe->setting;
int32 value = atoi(e->we.edittext.str);
@@ -1271,6 +1271,8 @@ static void CustCurrencyWndProc(Window *w, WindowEvent *e)
} break;
case WE_ON_EDIT_TEXT: {
+ if (e->we.edittext.str == NULL) break;
+
const char *b = e->we.edittext.str;
switch (WP(w, def_d).data_2) {
@@ -1279,7 +1281,7 @@ static void CustCurrencyWndProc(Window *w, WindowEvent *e)
break;
case CUSTCURR_SEPARATOR: /* Thousands seperator */
- _custom_currency.separator = (b[0] == '\0') ? ' ' : b[0];
+ _custom_currency.separator = StrEmpty(b) ? ' ' : b[0];
ttd_strlcpy(_str_separator, b, lengthof(_str_separator));
break;