Opened 17 years ago

Closed 15 years ago

#219 closed defect (fixed)

wcscmp() and wcsncmp() are broken

Reported by: dmik Owned by: bird
Priority: normal Milestone: libc-0.6.5
Component: libc Version: 0.6
Severity: normal Keywords:
Cc:

Description

wcscmp() and wcsncmp() assume that wchar_t is int while it seems to be short unsigned int by default (and may be made such with -fshort-wchar). This breaks the comparison results by usually negating them which greatly confuses applications.

Attached is a simple patch that casts wchar_t to int before getting the result of the comparison.

Attachments (1)

wcscmp.diff​ (758 bytes ) - added by dmik 17 years ago.

Download all attachments as: .zip

Change History (4)

by dmik, 17 years ago

Attachment: wcscmp.diff​ added

comment:1 by bird, 16 years ago

Milestone: → libc-0.6.4

comment:2 by bird, 16 years ago

Status: new → assigned

comment:3 by bird, 15 years ago

Resolution: → fixed
Status: assigned → closed

Addressed in r3761 (branch) and r3762 (trunk).

Note: See TracTickets for help on using tickets.