Skip to content

Commit

Permalink
hotfix for logger: use '%i' instead of '%zu'
Browse files Browse the repository at this point in the history
Work-around for #12485.

This can be reverted after the root-cause is fixed.
  • Loading branch information
bkueng committed Jul 16, 2019
1 parent ea0e164 commit e6aa035
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/modules/logger/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2011,7 +2011,7 @@ void Logger::write_info(LogType type, const char *name, const char *value)

/* construct format key (type and name) */
size_t vlen = strlen(value);
msg.key_len = snprintf(msg.key, sizeof(msg.key), "char[%zu] %s", vlen, name);
msg.key_len = snprintf(msg.key, sizeof(msg.key), "char[%i] %s", (int)vlen, name);
size_t msg_size = sizeof(msg) - sizeof(msg.key) + msg.key_len;

/* copy string value directly to buffer */
Expand All @@ -2037,7 +2037,7 @@ void Logger::write_info_multiple(LogType type, const char *name, const char *val

/* construct format key (type and name) */
size_t vlen = strlen(value);
msg.key_len = snprintf(msg.key, sizeof(msg.key), "char[%zu] %s", vlen, name);
msg.key_len = snprintf(msg.key, sizeof(msg.key), "char[%i] %s", (int)vlen, name);
size_t msg_size = sizeof(msg) - sizeof(msg.key) + msg.key_len;

/* copy string value directly to buffer */
Expand Down

0 comments on commit e6aa035

Please sign in to comment.