[Client] Fix for truncation of strings with null in writeValue std::string overload

This commit is contained in:
boozer2 2021-05-21 19:53:08 -06:00 committed by h2zero
parent 7815d89dbf
commit 30d6c399b8

View file

@ -712,7 +712,7 @@ std::string NimBLERemoteCharacteristic::toString() {
* @return false if not connected or cant perform write for some reason.
*/
bool NimBLERemoteCharacteristic::writeValue(const std::string &newValue, bool response) {
return writeValue((uint8_t*)newValue.c_str(), strlen(newValue.c_str()), response);
return writeValue((uint8_t*)newValue.c_str(), newValue.length(), response);
} // writeValue