diff options
author | rubidium42 <rubidium@openttd.org> | 2021-04-27 20:26:56 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-05-13 23:13:17 +0200 |
commit | c73d64adf984036a99d6974b130eda65dfc18c6c (patch) | |
tree | 05390f3269bf3279d51b290cde02cf17c395a626 /src/network/network_gui.cpp | |
parent | f219354f891c45dcefad2dd0a2f1fd92b07e4ba5 (diff) | |
download | openttd-c73d64adf984036a99d6974b130eda65dfc18c6c.tar.xz |
Codechange: move passwords in settings to std::string
Diffstat (limited to 'src/network/network_gui.cpp')
-rw-r--r-- | src/network/network_gui.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 56fdc7309..67992cac7 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1032,7 +1032,7 @@ struct NetworkStartServerWindow : public Window { switch (widget) { case WID_NSS_SETPWD: /* If password is set, draw red '*' next to 'Set password' button. */ - if (!StrEmpty(_settings_client.network.server_password)) DrawString(r.right + WD_FRAMERECT_LEFT, this->width - WD_FRAMERECT_RIGHT, r.top, "*", TC_RED); + if (!_settings_client.network.server_password.empty()) DrawString(r.right + WD_FRAMERECT_LEFT, this->width - WD_FRAMERECT_RIGHT, r.top, "*", TC_RED); } } @@ -1156,7 +1156,7 @@ struct NetworkStartServerWindow : public Window { if (str == nullptr) return; if (this->widget_id == WID_NSS_SETPWD) { - strecpy(_settings_client.network.server_password, str, lastof(_settings_client.network.server_password)); + _settings_client.network.server_password = str; } else { int32 value = atoi(str); this->SetWidgetDirty(this->widget_id); @@ -2583,7 +2583,7 @@ struct NetworkCompanyPasswordWindow : public Window { void OnOk() { if (this->IsWidgetLowered(WID_NCP_SAVE_AS_DEFAULT_PASSWORD)) { - strecpy(_settings_client.network.default_company_pass, this->password_editbox.text.buf, lastof(_settings_client.network.default_company_pass)); + _settings_client.network.default_company_pass = this->password_editbox.text.buf; } NetworkChangeCompanyPassword(_local_company, this->password_editbox.text.buf); |