Bug 11407

Summary: Incorrect use of ctype functions
Product: UIM Reporter: Christian Biere <christianbiere>
Component: OtherAssignee: uim-bugs
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Correct use of isdigit(), isalpha() etc.

Description Christian Biere 2007-06-28 13:01:00 UTC
From the manual page for isdigit():
"The argument to isdigit() must be EOF or representable as an unsigned
char; otherwise, the result is undefined."

The same applies to isalnum() etc. This matters for implementations which use "signed char" as char (as common on x86) because negative values (0x80..0xFF) will not be in the range of 0...UCHAR_MAX due to integer promotion rules. This yields typically either bogus results or crashes.
Comment 1 Christian Biere 2007-06-28 13:02:28 UTC
Created attachment 10489 [details] [review]
Correct use of isdigit(), isalpha() etc.
Comment 2 Etsushi Kato 2007-07-10 02:36:34 UTC
Patch applied.  Thanks!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.