diff options
| author | Tyge Lovset <[email protected]> | 2023-08-17 05:34:38 +0200 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2023-08-17 05:34:38 +0200 |
| commit | be0e64a9a19d3ca459284c61c497d141a78df1d7 (patch) | |
| tree | e2005e0a29d9e7386647ad9d92411635d01574c6 /src/utf8code.c | |
| parent | 2ba238e66efec7b6d895425c4f1160b3b72d242b (diff) | |
| download | STC-modified-be0e64a9a19d3ca459284c61c497d141a78df1d7.tar.gz STC-modified-be0e64a9a19d3ca459284c61c497d141a78df1d7.zip | |
Renamed "internal" csview member .str => .buf, as it is not null terminated like crawstr .str member.
Diffstat (limited to 'src/utf8code.c')
| -rw-r--r-- | src/utf8code.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utf8code.c b/src/utf8code.c index 4abf10ea..e326e6b9 100644 --- a/src/utf8code.c +++ b/src/utf8code.c @@ -105,10 +105,10 @@ int utf8_icmp_sv(const csview s1, const csview s2) { utf8_decode_t d1 = {.state=0}, d2 = {.state=0}; intptr_t j1 = 0, j2 = 0; while ((j1 < s1.size) & (j2 < s2.size)) { - do { utf8_decode(&d1, (uint8_t)s1.str[j1++]); } while (d1.state); - do { utf8_decode(&d2, (uint8_t)s2.str[j2++]); } while (d2.state); + do { utf8_decode(&d1, (uint8_t)s1.buf[j1++]); } while (d1.state); + do { utf8_decode(&d2, (uint8_t)s2.buf[j2++]); } while (d2.state); int32_t c = (int32_t)utf8_casefold(d1.codep) - (int32_t)utf8_casefold(d2.codep); - if (c || !s2.str[j2 - 1]) // OK if s1.size and s2.size are npos + if (c || !s2.buf[j2 - 1]) // OK if s1.size and s2.size are npos return (int)c; } return (int)(s1.size - s2.size); |
