From 97535a5f6f354bf39438e8d2b9aa54534b07a113 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 9 May 2022 21:45:09 -0500 Subject: [PATCH] Bugfix: NULL is a valid character, causing utf8 not to properly print NULL characters. The function f_utf_unicode_from() is incorrectly treating f_utf_char_t as a string (or a pointer). The f_utf_char_t is a 32-bit integer. The !0 check is therefore incorrect. This affects all print functions. --- level_0/f_utf/c/utf/convert.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/level_0/f_utf/c/utf/convert.c b/level_0/f_utf/c/utf/convert.c index a213139..7f738e3 100644 --- a/level_0/f_utf/c/utf/convert.c +++ b/level_0/f_utf/c/utf/convert.c @@ -214,10 +214,8 @@ extern "C" { f_status_t f_utf_unicode_from(const f_utf_char_t unicode, const f_array_length_t width_max, f_string_t *character) { #ifndef _di_level_0_parameter_checking_ if (width_max < 1) return F_status_set_error(F_parameter); - if (!unicode) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - // @fixme the code here needs to be reviewed for endianess accuracy for both big and little endian. if (unicode > 0x10ffff) { return F_status_set_error(F_utf); } -- 1.8.3.1