Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
logging: Use vsnprintk instead of vsnprintf
The printk family of functions is used elsewhere, so make this
consistent. Also, printk has a smaller stack footprint.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  • Loading branch information
jhedberg committed Jul 25, 2018
1 parent c68ab81 commit 1292609
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions subsys/logging/log_core.c
Expand Up @@ -12,8 +12,6 @@
#include <misc/printk.h>
#include <assert.h>
#include <atomic.h>
#include <stdio.h>
#include <atomic.h>

#ifndef CONFIG_LOG_PRINTK_MAX_STRING_LENGTH
#define CONFIG_LOG_PRINTK_MAX_STRING_LENGTH 1
Expand Down Expand Up @@ -151,7 +149,7 @@ int log_printk(const char *fmt, va_list ap)
struct log_msg *msg;
int length;

length = vsnprintf(formatted_str,
length = vsnprintk(formatted_str,
sizeof(formatted_str), fmt, ap);

length = (length > sizeof(formatted_str)) ?
Expand Down

0 comments on commit 1292609

Please sign in to comment.