From 05005dcdfa4f2d0c8fe2e0f0a92103dccd4691ab Mon Sep 17 00:00:00 2001 From: rubidium42 Date: Mon, 14 Jun 2021 16:16:10 +0200 Subject: Codechange: [Network] Use std::string instead of char[] for the name of the file that is downloading --- src/network/network_content_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/network/network_content_gui.cpp') diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index dfd4370b3..483e2b527 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -131,7 +131,7 @@ void BaseNetworkContentDownloadStatusWindow::DrawWidget(const Rect &r, int widge StringID str; if (this->downloaded_bytes == this->total_bytes) { str = STR_CONTENT_DOWNLOAD_COMPLETE; - } else if (!StrEmpty(this->name)) { + } else if (!this->name.empty()) { SetDParamStr(0, this->name); SetDParam(1, this->downloaded_files); SetDParam(2, this->total_files); @@ -147,7 +147,7 @@ void BaseNetworkContentDownloadStatusWindow::DrawWidget(const Rect &r, int widge void BaseNetworkContentDownloadStatusWindow::OnDownloadProgress(const ContentInfo *ci, int bytes) { if (ci->id != this->cur_id) { - strecpy(this->name, ci->filename.c_str(), lastof(this->name)); + this->name = ci->filename; this->cur_id = ci->id; this->downloaded_files++; } -- cgit v1.2.3-70-g09d2