From 2e136aa341fead57ee60ad8f1718cb9584baa03b Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Fri, 4 Oct 2024 12:49:48 -0400 Subject: log: Accept NULL section Signed-off-by: Andrew Opalach --- src/log.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/log.c b/src/log.c index 409e94d..4ae2184 100644 --- a/src/log.c +++ b/src/log.c @@ -1,6 +1,6 @@ #include "../include/al/log.h" -//#define AL_LOG_SKIP +#define AL_LOG_SKIP #define AL_LOG_MESSAGE_SIZE 511 #define AL_LOG_USE_SECTION #ifdef AL_LOG_USE_SECTION @@ -51,6 +51,7 @@ s32 _al_log(const char *level, const char *section, const char *name, const s32 #else va_list args; va_start(args, fmt); + if (!section) section = ""; #ifdef AL_LOG_SKIP s32 ret = al_printf(AL_LOG_TEMPLATE, name, line, func, level, section); ret += al_vprintf(fmt, args); @@ -72,6 +73,7 @@ s32 _al_logv(const char *level, const char *section, const char *name, const s32 #if AL_FORCE_DISABLE_OUTPUT return 0; #else + if (!section) section = ""; #ifdef AL_LOG_SKIP s32 ret = al_printf(AL_LOG_TEMPLATE, name, line, func, level, section); ret += al_vprintf(fmt, args); -- cgit v1.2.3-101-g0448