summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2024-10-04 12:49:48 -0400
committerAndrew Opalach <andrew@akon.city> 2024-10-04 12:49:48 -0400
commit2e136aa341fead57ee60ad8f1718cb9584baa03b (patch)
tree2bce016fc310bbe631fcf4ab751caa0a8490ba9e
parentbd79d0b57f76f290bffcd8749f60f7e5870d998a (diff)
downloadlibalabaster-2e136aa341fead57ee60ad8f1718cb9584baa03b.tar.gz
libalabaster-2e136aa341fead57ee60ad8f1718cb9584baa03b.tar.bz2
libalabaster-2e136aa341fead57ee60ad8f1718cb9584baa03b.zip
log: Accept NULL section
Signed-off-by: Andrew Opalach <andrew@akon.city>
-rw-r--r--src/log.c4
1 files changed, 3 insertions, 1 deletions
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);