From c1d19ed0a8d47e48584f3c09b30bac42e93203d8 Mon Sep 17 00:00:00 2001 From: servostar Date: Fri, 12 Apr 2024 17:36:13 +0200 Subject: [PATCH] added handling of registering a NULL stream for logging --- src/sys/log.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sys/log.c b/src/sys/log.c index bbf2c37..e3a7cd6 100644 --- a/src/sys/log.c +++ b/src/sys/log.c @@ -16,6 +16,9 @@ void log_init(void) void log_register_stream(FILE* restrict stream) { + if (stream == NULL) + PANIC("stream to register is NULL"); + if (GlobalLogger.stream_count == 0) { GlobalLogger.streams = (FILE**) malloc(sizeof(FILE*));