| [ Return to Bugs & Features | Roadmap 1.1 | SVN ⇄ GIT ]
STR #731
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 3 - Moderate, e.g. unable to compile the software |
Scope: | 2 - Specific to an operating system |
Subsystem: | Core Library |
Summary: | Negative value passed to isalpha() in Fl::handle() |
Version: | 1.1.6 |
Created By: | syrja |
Assigned To: | mike |
Fix Version: | 1.1.7 (SVN: v4064) |
Update Notification: | |
Trouble Report Files:
No files
Trouble Report Comments:
|
#1 | syrja 01:58 Feb 25, 2005 |
| fl.cxx line 699:
{char* c = (char*)event_text(); // cast away const if (!isalpha(*c)) return 0; *c = isupper(*c) ? tolower(*c) : toupper(*c);} e_number = e = FL_SHORTCUT;
*c is signed char and passes values greater than 127 as negative numbers to isalpha() function.
Because of assert inside msvcr71d.dll isalpha() function, this crashes Windows Visual Studio 2003 debug builds, when pressing finnish keyboard keys ä, ö and å.
| |
|
#2 | mike 11:24 Mar 05, 2005 |
| Fixed in Subversion repository.
Changed char *c to unsigned char *c...
| |
|
#3 | spitzak 14:30 Mar 05, 2005 |
|
WTF?
Sure fixing it is ok, but I don't think VC is obeying the c library standard. Certainly it was always intended to accept negative characters, the first C implementations did not have unsigned characters at all.
| |
|
#4 | mike 14:45 Mar 05, 2005 |
|
Actually, no, the behavior of is*() and to*() with negative integers other than EOF (-1) is undefined. This is a real bug...
Unfortunately, the ANSI folks didn't bother defining a standard for the char type - it can be signed or unsigned by default...
| |
[ Return to Bugs & Features ]
|
| |