From ce1b447c992185086f0fdde21c49c13e0ac722e5 Mon Sep 17 00:00:00 2001 From: prpr Date: Fri, 8 Apr 2022 00:19:15 +0000 Subject: [PATCH] Fix length bug and size warning --- xconv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xconv.c b/xconv.c index 34b828d..e1a5122 100644 --- a/xconv.c +++ b/xconv.c @@ -9,7 +9,7 @@ add_unicode(char **d, size_t *len, uint16_t u) // 1 byte if (*len < 1) return 0; (*d)[0] = u; - (*d)++, *len--; + (*d)++, (*len)--; return 1; } if (u < 0x800) @@ -22,7 +22,9 @@ add_unicode(char **d, size_t *len, uint16_t u) *d += 2, *len -= 2; return 1; } +#if 0 if (u < 0x10000) +#endif { // 3 bytes if (*len < 3) return 0;