diff options
| author | Ha Thach <[email protected]> | 2025-12-19 13:16:47 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-19 13:16:47 +0700 |
| commit | 83fa3bbffe2237303ff1ae92fe0b6c8384073993 (patch) | |
| tree | a2703ed755ddb6cd7704a477bd4ada7207363815 /src | |
| parent | 2b9a778621a2d80c4fa55b0e0deed29756a0a287 (diff) | |
| parent | 49a8529dcf8f5b2616640e6f96dcb27e930d1f0d (diff) | |
Merge pull request #3419 from hathach/remove-sprintf
remove the usage snprintf
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/tusb_debug.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/tusb_debug.h b/src/common/tusb_debug.h index e0e09f5ce..ba5b4afd1 100644 --- a/src/common/tusb_debug.h +++ b/src/common/tusb_debug.h @@ -117,12 +117,16 @@ static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint3 } } - // not found return the key value in hex + #ifndef CFG_TUSB_DEBUG_PRINTF + // not found return the key value in hex if no custom printf is defined static char not_found[11]; - if (snprintf(not_found, sizeof(not_found), "0x%08lX", (unsigned long) key) <= 0) { + if (snprintf(not_found, sizeof(not_found), "0x%08lX", (unsigned long)key) <= 0) { not_found[0] = 0; } return not_found; + #else + return "NotFound"; + #endif } #endif // CFG_TUSB_DEBUG |
