forked from test34/can_wizard
fix bug with snprintf used instead of vsnprintf
This commit is contained in:
parent
598669779f
commit
27c4f26f8f
1 changed files with 2 additions and 3 deletions
|
@ -15,10 +15,9 @@ void init_tx_ringbuf() {
|
||||||
// This function will be called by the ESP log library every time ESP_LOG needs to be performed.
|
// This function will be called by the ESP log library every time ESP_LOG needs to be performed.
|
||||||
// @important Do NOT use the ESP_LOG* macro's in this function ELSE recursive loop and stack overflow! So use printf() instead for debug messages.
|
// @important Do NOT use the ESP_LOG* macro's in this function ELSE recursive loop and stack overflow! So use printf() instead for debug messages.
|
||||||
int xvprintf(const char *fmt, va_list args) {
|
int xvprintf(const char *fmt, va_list args) {
|
||||||
char msg_to_send[500];
|
char msg_to_send[200];
|
||||||
size_t str_len;
|
size_t str_len;
|
||||||
str_len = snprintf(msg_to_send, 499, fmt, va_arg(args, int), va_arg(args, char *));
|
str_len = vsnprintf(msg_to_send, 199, fmt, args);
|
||||||
va_end(args);
|
|
||||||
xRingbufferSend(can_messages, msg_to_send, str_len + 1, pdMS_TO_TICKS(100));
|
xRingbufferSend(can_messages, msg_to_send, str_len + 1, pdMS_TO_TICKS(100));
|
||||||
return str_len;
|
return str_len;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue