added handling of registering a NULL stream for logging

This commit is contained in:
Sven Vogel 2024-04-12 17:36:13 +02:00
parent 949bbb185a
commit c1d19ed0a8
1 changed files with 3 additions and 0 deletions

View File

@ -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*));