From: Kevin Day Date: Mon, 30 Nov 2020 03:38:36 +0000 (-0600) Subject: Bugfix: provide static variable "fll_error_string_null_s". X-Git-Tag: 0.5.2~53 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=f28fcb64d3b96ce160361deacd81c0d7581b84f4;p=fll 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. --- 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