buf in libc/locale/utf8.c: typo->not quite one-to-one
Rich Felker <[email protected]>
| Newsgroups | gmane.os.freebsd.bugbusters |
|---|---|
| Message-ID | <[email protected]> |
i'm not a freebsd user and haven't run any tests on this, but while
reading the freebsd libc sources i found what appears to be a typo in
utf8.c's mbrtowc implementation. for 6-byte sequences, the top 6 bits
are compared against 111111 rather than the top 7 bits being compared
against 1111110. this results in the illegal bytes fe and ff being
treated the same as the legal bytes fc and fd.
the fix is (sorry for my lame inline handmade patch):
- } else if ((ch & 0xfc) == 0xfc) {
+ } else if ((ch & 0xfe) == 0xfc) {
rich
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugbusters
To unsubscribe, send any mail to "[email protected]"