From bf3ad2be2f0ffe52aa0a97a276c8af0629b9b864 Mon Sep 17 00:00:00 2001 From: luocai Date: Mon, 21 Oct 2024 19:35:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=87=E7=BA=A7=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=A0=A1=E9=AA=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Application.cpp b/Application.cpp index 77f0fe8..1001deb 100644 --- a/Application.cpp +++ b/Application.cpp @@ -258,9 +258,10 @@ void Application::upgradeDevice(const QString &file) { int position = baseName.indexOf(versionPrefix); if (position < 0 || ((baseName.length() - position) < std::strlen(version))) { emit newMessage(2, "OTA升级", "文件名格式不合法!"); + LOG(error) << "baseName: " << baseName.toStdString() << ", position: " << position; return; } - QString firmware = baseName.mid(position, std::strlen(version)); + QString firmware = baseName.mid(position); if (device->isConnected()) { device->requestOta(firmware, file); } else {