diff --git a/src/MPDeviceBleImpl.cpp b/src/MPDeviceBleImpl.cpp index 7d925a53..3c8e90b1 100644 --- a/src/MPDeviceBleImpl.cpp +++ b/src/MPDeviceBleImpl.cpp @@ -1913,6 +1913,11 @@ void MPDeviceBleImpl::getBleName(const MessageHandlerCbData &cb) bleNameArr = DEFAULT_BLE_NAME.toUtf8(); qWarning() << "Invalid character in BLE name"; } + if (bleNameArr.contains(ZERO_BYTE)) + { + // Cut zero bytes from the end of the array + bleNameArr = bleNameArr.left(bleNameArr.indexOf(ZERO_BYTE)); + } cb(true, "", bleNameArr); });