From e38630097e4f829613e5f0247f4a9d8a572f4d17 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Tue, 17 Jan 2017 17:09:13 -0700 Subject: [PATCH] UartOW.cpp example: Use .data() string accessor instead of .c_str(). .c_str() works accidentally, but is technically incorrect as these "strings" can have embedded 0 bytes in them. Signed-off-by: Jon Trulson Signed-off-by: Brendan Le Foll --- examples/c++/UartOW.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/c++/UartOW.cpp b/examples/c++/UartOW.cpp index bccc7a2c3..91c94e72e 100644 --- a/examples/c++/UartOW.cpp +++ b/examples/c++/UartOW.cpp @@ -59,7 +59,7 @@ main(int argc, char** argv) while (!id.empty()) { // hack so we don't need to cast each element of the romcode // for printf purposes - uint8_t* ptr = (uint8_t*) id.c_str(); + uint8_t* ptr = (uint8_t*) id.data(); // The first byte (0) is the device type (family) code. // The last byte (7) is the rom code CRC value. The