diff --git a/src/trace.cpp b/src/trace.cpp index 4ef1919..34239a4 100644 --- a/src/trace.cpp +++ b/src/trace.cpp @@ -229,14 +229,18 @@ void trace_dump(uint8_t severity, const char *prefix, uint8_t *address, size_t s print(severity, buffer, idx); } -// TODO: POZOR!!! tady si nejsem jisty, zda je spravne pouziti __FlashStringHelperu v snprintf_P !!!! void trace_dump(uint8_t severity, const __FlashStringHelper *prefix, uint8_t *address, size_t size) { char buffer[MAX_LINE_LEN + 1 + 3]; int idx = 0; if (prefix) - idx = snprintf_P(buffer, MAX_LINE_LEN, PSTR("%s"), prefix); + { + char dummy[64]; + + strcpy_P(dummy, (const char *)prefix); + idx = snprintf_P(buffer, MAX_LINE_LEN, PSTR("%s"), dummy); + } while ((idx < MAX_LINE_LEN) && size) {