git: locale/UTF-8: Fixed upper bound logic

John Marino marino at
Sun Sep 13 03:20:24 PDT 2015

commit 3d4b9338af812db4143a3a95fadfe72ecc51fd75
Author: John Marino <draco at>
Date:   Sun Sep 13 12:08:10 2015 +0200

    locale/UTF-8: Fixed upper bound logic
    The upper bound for UTF-8 is 0x10FFFF.  Using two's complement to check
    this range is wrong.  Valid values such as 0x20000, 0x40000 and 0x80000
    were wrongly failing will illegal sequence errors.  Using simple
    comparison operators should fix the logic.

Summary of changes:
 lib/libc/locale/utf8.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list