From 85a88a982f4688482da49d4d5d119ba659d4d870 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Fri, 26 Feb 2021 16:54:29 +0100 Subject: selectw verifies add/set options; implemented multi select --- fw/fe310/eos/unicode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fw/fe310/eos/unicode.c') diff --git a/fw/fe310/eos/unicode.c b/fw/fe310/eos/unicode.c index e2fb772..29100c7 100644 --- a/fw/fe310/eos/unicode.c +++ b/fw/fe310/eos/unicode.c @@ -106,7 +106,7 @@ int utf8_verify(utf8_t *str, int str_size, int *str_len) { ch_l = utf8_dec(str + len, &ch); if (ch_l > 0) { if (ch == 0) { - *str_len = len; + if (str_len) *str_len = len; return UTF_OK; } len += ch_l; @@ -114,7 +114,8 @@ int utf8_verify(utf8_t *str, int str_size, int *str_len) { break; } } - *str_len = len; + + if (str_len) *str_len = len; return UTF_ERR; } -- cgit v1.2.3