fix potential crash with firmware dialog (when closing dialog via X and opening it again)

This commit is contained in:
Arisotura 2021-11-18 18:25:19 +01:00
parent f73df85d1c
commit 08eda46706
2 changed files with 4 additions and 4 deletions

View File

@ -55,7 +55,7 @@ FirmwareSettingsDialog::~FirmwareSettingsDialog()
delete ui; delete ui;
} }
void FirmwareSettingsDialog::on_dialogButtons_accepted() void FirmwareSettingsDialog::on_FirmwareSettingsDialog_accepted()
{ {
std::string newName = ui->usernameEdit->text().toStdString(); std::string newName = ui->usernameEdit->text().toStdString();
strncpy(Config::FirmwareUsername, newName.c_str(), 63); Config::FirmwareUsername[63] = '\0'; strncpy(Config::FirmwareUsername, newName.c_str(), 63); Config::FirmwareUsername[63] = '\0';
@ -73,7 +73,7 @@ void FirmwareSettingsDialog::on_dialogButtons_accepted()
closeDlg(); closeDlg();
} }
void FirmwareSettingsDialog::on_dialogButtons_rejected() void FirmwareSettingsDialog::on_FirmwareSettingsDialog_rejected()
{ {
closeDlg(); closeDlg();
} }

View File

@ -102,8 +102,8 @@ public:
} }
private slots: private slots:
void on_dialogButtons_accepted(); void on_FirmwareSettingsDialog_accepted();
void on_dialogButtons_rejected(); void on_FirmwareSettingsDialog_rejected();
private: private:
Ui::FirmwareSettingsDialog* ui; Ui::FirmwareSettingsDialog* ui;