mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-20 23:17:35 -04:00
Because `vsnprintf` return value means: " The number of characters that would have been written if n had been sufficiently large, not counting the terminating null character. If an encoding error occurs, a negative number is returned. " `Logger` crashed when log msg was longer than LOGGER_BUFFER_SIZE. Checking `vsnprintf` return value solves this issue.
22 lines
527 B
C++
22 lines
527 B
C++
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include <log/log.hpp>
|
|
#include <cstdarg>
|
|
__attribute__((weak)) int log_Log(
|
|
logger_level level, const char *file, int line, const char *function, const char *fmt, ...)
|
|
{
|
|
va_list args;
|
|
va_start(args, fmt);
|
|
va_end(args);
|
|
return 0;
|
|
}
|
|
|
|
__attribute__((weak)) int log_Printf(const char *fmt, ...)
|
|
{
|
|
va_list args;
|
|
va_start(args, fmt);
|
|
va_end(args);
|
|
return 0;
|
|
}
|