mirror of
https://github.com/swaywm/sway.git
synced 2024-12-28 07:56:31 +01:00
utf8_size: fix loop boundary
Found through static analysis
This commit is contained in:
parent
c73c552cae
commit
971b2f11f9
1 changed files with 1 additions and 1 deletions
|
@ -92,7 +92,7 @@ static const struct {
|
||||||
|
|
||||||
int utf8_size(const char *s) {
|
int utf8_size(const char *s) {
|
||||||
uint8_t c = (uint8_t)*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) {
|
if ((c & sizes[i].mask) == sizes[i].result) {
|
||||||
return sizes[i].octets;
|
return sizes[i].octets;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue