mirror of
https://github.com/netwide-assembler/nasm
synced 2026-08-26 16:23:04 -04:00
strfunc: fix UTF-8 mid-character limit
This commit is contained in:
parent
2cb033e0d9
commit
503e71d3ee
1 changed files with 2 additions and 2 deletions
|
|
@ -46,7 +46,7 @@ static size_t utf8_to_16le(uint8_t *str, size_t len, char *op)
|
|||
|
||||
if (c < 0x80) {
|
||||
EMIT(c);
|
||||
} else if (c < 0xa0 || c >= 0xfe) {
|
||||
} else if (c < 0xc0 || c >= 0xfe) {
|
||||
/* Invalid UTF-8 */
|
||||
return -1;
|
||||
} else if (c < 0xe0) {
|
||||
|
|
@ -110,7 +110,7 @@ static size_t utf8_to_32le(uint8_t *str, size_t len, char *op)
|
|||
|
||||
if (c < 0x80) {
|
||||
EMIT(c);
|
||||
} else if (c < 0xa0 || c >= 0xfe) {
|
||||
} else if (c < 0xc0 || c >= 0xfe) {
|
||||
/* Invalid UTF-8 */
|
||||
return -1;
|
||||
} else if (c < 0xe0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue