From 65cbde4b30f8fdf6d4cf1196f6a596a5550c9aee Mon Sep 17 00:00:00 2001 From: rubidium42 Date: Wed, 28 Apr 2021 16:46:24 +0200 Subject: Codechange: move currency settings to std::string --- src/settings_gui.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/settings_gui.cpp') diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 15c6a887e..664cfbd21 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -2668,7 +2668,7 @@ struct CustomCurrencyWindow : Window { case WID_CC_SEPARATOR: SetDParamStr(0, _custom_currency.separator); str = STR_JUST_RAW_STRING; - len = sizeof(_custom_currency.separator) - 1; // Number of characters excluding '\0' termination + len = 7; line = WID_CC_SEPARATOR; break; @@ -2676,7 +2676,7 @@ struct CustomCurrencyWindow : Window { case WID_CC_PREFIX: SetDParamStr(0, _custom_currency.prefix); str = STR_JUST_RAW_STRING; - len = sizeof(_custom_currency.prefix) - 1; // Number of characters excluding '\0' termination + len = 15; line = WID_CC_PREFIX; break; @@ -2684,7 +2684,7 @@ struct CustomCurrencyWindow : Window { case WID_CC_SUFFIX: SetDParamStr(0, _custom_currency.suffix); str = STR_JUST_RAW_STRING; - len = sizeof(_custom_currency.suffix) - 1; // Number of characters excluding '\0' termination + len = 15; line = WID_CC_SUFFIX; break; @@ -2728,15 +2728,15 @@ struct CustomCurrencyWindow : Window { break; case WID_CC_SEPARATOR: // Thousands separator - strecpy(_custom_currency.separator, str, lastof(_custom_currency.separator)); + _custom_currency.separator = str; break; case WID_CC_PREFIX: - strecpy(_custom_currency.prefix, str, lastof(_custom_currency.prefix)); + _custom_currency.prefix = str; break; case WID_CC_SUFFIX: - strecpy(_custom_currency.suffix, str, lastof(_custom_currency.suffix)); + _custom_currency.suffix = str; break; case WID_CC_YEAR: { // Year to switch to euro -- cgit v1.2.3-54-g00ecf