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:
Yuri Pankov 2018-11-26 15:33:55 +00:00
parent 6b31818dee
commit f2dfec1ffb

View File

@ -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;
}