From 998815babb9e6e0a51584478115ac098996bf5a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Laranjeira?= Date: Tue, 21 Sep 2021 21:29:20 -0300 Subject: [PATCH] Added static modifier to private logger variables * This prevents the user from referencing the variables using the extern keyword and them tampering with them; --- src/message_logger.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/message_logger.c b/src/message_logger.c index 9ce60a9..e290f65 100644 --- a/src/message_logger.c +++ b/src/message_logger.c @@ -4,9 +4,9 @@ #include "message_logger.h" // Private variables: -char time_fmt[TIME_FMT_SIZE] = "%H:%M:%S %d-%m-%Y"; -FILE *log_file = NULL; -pthread_mutex_t *logger_recursive_mutex = NULL; +static char time_fmt[TIME_FMT_SIZE] = "%H:%M:%S %d-%m-%Y"; +static FILE *log_file = NULL; +static pthread_mutex_t *logger_recursive_mutex = NULL; // Private function headers: static void apply_all_default_attributes();