From f28fcb64d3b96ce160361deacd81c0d7581b84f4 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 29 Nov 2020 21:38:36 -0600 Subject: [PATCH] Bugfix: provide static variable "fll_error_string_null_s". When using the fl_color_print functions, the context before and after pointers may safely be NULL. When using the printf functions, the context before and after pointers cannot safely be NULL. In the second case, a global static is now provided that is essentially a NULL string of a compatible type. --- level_2/fll_error/c/error-common.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/level_2/fll_error/c/error-common.h b/level_2/fll_error/c/error-common.h index b5d8e0c..b39544e 100644 --- a/level_2/fll_error/c/error-common.h +++ b/level_2/fll_error/c/error-common.h @@ -76,6 +76,13 @@ extern "C" { #define fll_macro_error_print_t_initialize_warning() fll_macro_error_print_t_initialize(f_macro_file_t_initialize(f_type_warning, f_type_descriptor_warning, f_file_flag_write_only), f_console_verbosity_normal, fll_error_print_warning, f_color_set_t_initialize, f_color_set_t_initialize) #endif // _di_fll_error_print_t_ +/** + * Set the context and notable to this to safely allow for fprintf uses when there is no color to be used. + */ +#ifndef _di_fll_error_string_null_s_ + const static f_string_static_t fll_error_string_null_s = f_macro_string_static_t_initialize("", 0); +#endif // _di_fll_error_string_null_s_ + #ifdef __cplusplus } // extern "C" #endif -- 1.8.3.1