core: use std::string in error_callback

No naked free().

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-08 23:32:17 +02:00 committed by bstoeger
parent 71f3189a31
commit d05e289507
8 changed files with 40 additions and 74 deletions

View file

@ -440,12 +440,11 @@ void DownloadFromDCWidget::on_downloadCancelRetryButton_clicked()
// this breaks an "else if" across lines... not happy...
#endif
if (data->vendor() == "Uemis") {
char *colon;
char *devname = copy_qstring(ui.device->currentText());
if ((colon = strstr(devname, ":\\ (UEMISSDA)")) != NULL) {
*(colon + 2) = '\0';
report_info("shortened devname to \"%s\"", devname);
QString devname = ui.device->currentText();
auto colon = devname.indexOf(":\\ (UEMISSDA)");
if (colon >= 0) {
devname.resize(colon + 2);
report_info("shortened devname to \"%s\"", qPrintable(devname));
}
data->setDevName(devname);
} else {