mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
hotfix for logger: use '%i' instead of '%zu'
Work-around for https://github.com/PX4/Firmware/issues/12485. This can be reverted after the root-cause is fixed.
This commit is contained in:
@@ -2011,7 +2011,7 @@ void Logger::write_info(LogType type, const char *name, const char *value)
|
|||||||
|
|
||||||
/* construct format key (type and name) */
|
/* construct format key (type and name) */
|
||||||
size_t vlen = strlen(value);
|
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;
|
size_t msg_size = sizeof(msg) - sizeof(msg.key) + msg.key_len;
|
||||||
|
|
||||||
/* copy string value directly to buffer */
|
/* copy string value directly to buffer */
|
||||||
@@ -2037,7 +2037,7 @@ void Logger::write_info_multiple(LogType type, const char *name, const char *val
|
|||||||
|
|
||||||
/* construct format key (type and name) */
|
/* construct format key (type and name) */
|
||||||
size_t vlen = strlen(value);
|
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;
|
size_t msg_size = sizeof(msg) - sizeof(msg.key) + msg.key_len;
|
||||||
|
|
||||||
/* copy string value directly to buffer */
|
/* copy string value directly to buffer */
|
||||||
|
|||||||
Reference in New Issue
Block a user