Skip to content

Commit

Permalink
fix wrong max prefix length in nrfconnect logs (#3869)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjc13 authored and pull[bot] committed Dec 7, 2020
1 parent a2376ea commit 6058632
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/platform/nrfconnect/Logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ void LogV(uint8_t module, uint8_t category, const char * msg, va_list v)
char formattedMsg[CHIP_DEVICE_CONFIG_LOG_MESSAGE_MAX_SIZE];
size_t prefixLen = 0;

constexpr size_t maxPrefixLen = ChipLoggingModuleNameLen + 3;
// Max size for "[TAG] {UINT32}"
constexpr size_t maxPrefixLen = ChipLoggingModuleNameLen + 10 + 3;
static_assert(sizeof(formattedMsg) > maxPrefixLen);

prefixLen += snprintf(formattedMsg, sizeof(formattedMsg), "%u", k_uptime_get_32());
Expand Down

0 comments on commit 6058632

Please sign in to comment.