From 4620599527d863f90f1147e702c04549df53c56e Mon Sep 17 00:00:00 2001 From: Robbie Drage Date: Fri, 17 Feb 2023 15:05:50 +1300 Subject: [PATCH] Fix use of QString::QString.asprintf() asprintf is a static method and does not modify the calling object. This fix assigns the returned QString to the calling object. Fixes issue #10450 --- src/Vehicle/MAVLinkLogManager.cc | 2 +- src/Vehicle/Vehicle.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Vehicle/MAVLinkLogManager.cc b/src/Vehicle/MAVLinkLogManager.cc index e43f6ab..cee13aa 100644 --- a/src/Vehicle/MAVLinkLogManager.cc +++ b/src/Vehicle/MAVLinkLogManager.cc @@ -150,7 +150,7 @@ MAVLinkLogProcessor::valid() bool MAVLinkLogProcessor::create(MAVLinkLogManager* manager, const QString path, uint8_t id) { - _fileName.asprintf("%s/%03d-%s%s", + _fileName = _fileName.asprintf("%s/%03d-%s%s", path.toLatin1().data(), id, QDateTime::currentDateTime().toString("yyyy-MM-dd-hh-mm-ss-zzz").toLocal8Bit().data(), diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc index 6c25a05..5ebe689 100644 --- a/src/Vehicle/Vehicle.cc +++ b/src/Vehicle/Vehicle.cc @@ -1331,7 +1331,7 @@ QString Vehicle::vehicleUIDStr() { QString uid; uint8_t* pUid = (uint8_t*)(void*)&_uid; - uid.asprintf("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", + uid = uid.asprintf("%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X", pUid[0] & 0xff, pUid[1] & 0xff, pUid[2] & 0xff,