Bug 11407 - Incorrect use of ctype functions
Summary: Incorrect use of ctype functions
Status: RESOLVED FIXED
Alias: None
Product: UIM
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: uim-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-28 13:01 UTC by Christian Biere
Modified: 2007-07-10 02:36 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Correct use of isdigit(), isalpha() etc. (2.82 KB, patch)
2007-06-28 13:02 UTC, Christian Biere
Details | Splinter Review

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.