summaryrefslogtreecommitdiffhomepage
path: root/src/utf8code.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-06-10 11:29:17 +0200
committerTyge Løvset <[email protected]>2022-06-10 11:29:17 +0200
commit8883fc8108428878d3d6291ba8981cf6df72499c (patch)
tree9fbdc79019501714dc984c1fbd5eb2c7ea979bb4 /src/utf8code.c
parentf1d09dfcc7570e69eb6e9688b736f7b031b22b2d (diff)
downloadSTC-modified-8883fc8108428878d3d6291ba8981cf6df72499c.tar.gz
STC-modified-8883fc8108428878d3d6291ba8981cf6df72499c.zip
utf8 fixes and improvements. Some api changes.
Diffstat (limited to 'src/utf8code.c')
-rw-r--r--src/utf8code.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utf8code.c b/src/utf8code.c
index a6ecdb65..f64ede70 100644
--- a/src/utf8code.c
+++ b/src/utf8code.c
@@ -63,9 +63,9 @@ bool utf8_valid(const char* s) {
return d.state == 0;
}
-bool utf8_valid_n(const char* s, size_t n) {
+bool utf8_valid_n(const char* s, size_t nbytes) {
utf8_decode_t d = {.state=0};
- while ((n-- != 0) & (*s != 0))
+ while ((nbytes-- != 0) & (*s != 0))
utf8_decode(&d, (uint8_t)*s++);
return d.state == 0;
}