Skip to content

Commit f390246

Browse files
authored
Don't convert to null-terminated string prior to writeValue (#4473)
fixes: #4472
1 parent f7fb006 commit f390246

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: libraries/BLE/src/BLERemoteCharacteristic.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ std::string BLERemoteCharacteristic::toString() {
535535
* @return N/A.
536536
*/
537537
void BLERemoteCharacteristic::writeValue(std::string newValue, bool response) {
538-
writeValue((uint8_t*)newValue.c_str(), strlen(newValue.c_str()), response);
538+
writeValue((uint8_t*)newValue.data(), newValue.length(), response);
539539
} // writeValue
540540

541541

0 commit comments

Comments
 (0)