This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/18206] New: wcsncmp implementation does not behave the same as wcscmp and wmemcmp


https://sourceware.org/bugzilla/show_bug.cgi?id=18206

            Bug ID: 18206
           Summary: wcsncmp implementation does not behave the same as
                    wcscmp and wmemcmp
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: stli at linux dot vnet.ibm.com
                CC: drepper.fsp at gmail dot com

the wcsncmp implementation does not behave the same as wcscmp
and wmemcmp due to using substraction instead of comparision:

wchar_t w0[] = { WCHAR_MIN, 0 };
wchar_t w1[] = { WCHAR_MAX, 0 };

wcscmp (w0, w1) = -1
wcsncmp (w0, w1, 2) = 1
wmemcmp (w0, w1, 2) = -1

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]