Opened 10 years ago

Closed 8 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 10 years ago.

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by dmik

comment:1 Changed 9 years ago by bird

  • Milestone set to libc-0.6.4

comment:2 Changed 9 years ago by bird

  • Status changed from new to assigned

comment:3 Changed 8 years ago by bird

  • Resolution set to fixed
  • Status changed from assigned to closed

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

Note: See TracTickets for help on using tickets.