aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2018-07-01 23:14:43 +0900
committerDominique Martinet <asmadeus@codewreck.org>2018-07-02 08:03:41 +0900
commit971b2f11f9336c220870fa7504999e0fa5fe266a (patch)
tree612bb10f503a48888a4f17a43bb75ed7948bcd9c /common
parentc73c552cae435dd61ebbe0c76aa66570095375a9 (diff)
utf8_size: fix loop boundary
Found through static analysis
Diffstat (limited to 'common')
-rw-r--r--common/unicode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/unicode.c b/common/unicode.c
index 38a9b48e..5070e083 100644
--- a/common/unicode.c
+++ b/common/unicode.c
@@ -92,7 +92,7 @@ static const struct {
int utf8_size(const char *s) {
uint8_t c = (uint8_t)*s;
- for (size_t i = 0; i < sizeof(sizes) / 2; ++i) {
+ for (size_t i = 0; i < sizeof(sizes) / sizeof(*sizes); ++i) {
if ((c & sizes[i].mask) == sizes[i].result) {
return sizes[i].octets;
}