Skip to content

Commit

Permalink
Merge pull request #1059 from deXol/develop
Browse files Browse the repository at this point in the history
[BLE] Remove zero bytes from end of BLE name setting
  • Loading branch information
limpkin authored Jun 28, 2022
2 parents 363ecf5 + d48681e commit 52e54fc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/MPDeviceBleImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down

0 comments on commit 52e54fc

Please sign in to comment.