Fix uses of isupper() and isprint() - STR #3436

This commit is contained in:
ManoloFLTK 2024-05-15 14:59:13 +02:00
parent a9085c3b11
commit 9df6dc2aeb
2 changed files with 2 additions and 2 deletions

View File

@ -174,7 +174,7 @@ const char *Fl_Mac_App_Menu::quit = "Quit %@";
{
NSUInteger macMod = 0;
if ( value & FL_META ) macMod = NSEventModifierFlagCommand;
if ( value & FL_SHIFT || isupper(value) ) macMod |= NSEventModifierFlagShift;
if ( value & FL_SHIFT || (value > 0 && value < 127 && isupper(value)) ) macMod |= NSEventModifierFlagShift;
if ( value & FL_ALT ) macMod |= NSEventModifierFlagOption;
if ( value & FL_CTRL ) macMod |= NSEventModifierFlagControl;
[super setKeyEquivalentModifierMask:macMod];

View File

@ -233,7 +233,7 @@ static void kill_selection(Fl_Text_Editor* e) {
*/
int Fl_Text_Editor::kf_default(int c, Fl_Text_Editor* e) {
// FIXME: this function is a mess! Fix this!
if (!c || (!isprint(c) && c != '\t')) return 0;
if (!c || (!(c > 0 && c < 127 && isprint(c)) && c != '\t')) return 0;
char s[2] = "\0";
s[0] = (char)c;
kill_selection(e);