summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/unicode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/eos/unicode.c')
-rw-r--r--fw/fe310/eos/unicode.c5
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;
}