diff options
author | Uros Majstorovic <majstor@majstor.org> | 2021-02-26 16:54:29 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2021-02-26 16:54:29 +0100 |
commit | 85a88a982f4688482da49d4d5d119ba659d4d870 (patch) | |
tree | 921ea2713d2719bbdd79ae99376110ed62f29203 /fw/fe310/eos/unicode.c | |
parent | d14cec5a48d9d064481726af8b4d795c5f4ee039 (diff) |
selectw verifies add/set options; implemented multi select
Diffstat (limited to 'fw/fe310/eos/unicode.c')
-rw-r--r-- | fw/fe310/eos/unicode.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; } |