mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-15 06:42:51 +01:00
vi: fix UTF-8 detection.
PR: 202290 Submitted by: lampa@fit.vutbr.cz Reviewed by: bapt Approved by: kib (mentor, implicit) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D17950
This commit is contained in:
parent
6b31818dee
commit
f2dfec1ffb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=340976
@ -96,7 +96,7 @@ looks_utf8(const char *ibuf, size_t nbytes)
|
||||
if (i >= nbytes)
|
||||
goto done;
|
||||
|
||||
if (buf[i] & 0x40) /* 10xxxxxx */
|
||||
if ((buf[i] & 0xc0) != 0x80) /* 10xxxxxx */
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user