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 {