From: Kevin Day Date: Tue, 10 May 2022 02:45:09 +0000 (-0500) Subject: Bugfix: NULL is a valid character, causing utf8 not to properly print NULL characters. X-Git-Tag: 0.5.10~160 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=97535a5f6f354bf39438e8d2b9aa54534b07a113;p=fll 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. --- 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); }