File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
connectivity/FEATURE_BLE/source/common Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -522,7 +522,12 @@ const char *to_string(const UUID& uuid)
522522 static constexpr const char *HEX = " 0123456789ABCDEF" ;
523523 static constexpr const size_t HYPHENS_DELIMITER_COUNT = 4 ;
524524
525- static char string_buffer[ROW_COUNT][UUID::LENGTH_OF_LONG_UUID + HYPHENS_DELIMITER_COUNT];
525+ /*
526+ * For each hex digit, we require 2 bytes. So, we need at most 2 * 16 = 32 bytes for the hex digits.
527+ * In the case of 128-bit UUIDs, we also need space for 4 hyphen delimiters.
528+ * An additional byte is required at the end of each array to store the null terminator.
529+ */
530+ static char string_buffer[ROW_COUNT][2 * UUID::LENGTH_OF_LONG_UUID + HYPHENS_DELIMITER_COUNT + 1 ];
526531 static uint8_t idx = 0 ;
527532
528533 ++idx;
You can’t perform that action at this time.
0 commit comments