Menu

#4 Problems with tolower (Linux)

open
nobody
None
5
2000-05-08
2000-05-08
Anonymous
No

I found a problem in tolower in dune compiling with gcc 2.8.1 (slackware):

in Line 2581 swt.c

accel->key = _invKeycodeMap[tolower(key)];

If key is about 0x10000 or 0xffff ?, tolower give back a very big
result, very much bigger than the space in the array
"_invKeycodeMap". Consequence is a coredump.

Possibly, this bug is related to several "locale" settings.

As a fast fix, i used:

if (key<=256)
accel->key = _invKeycodeMap[tolower(key)];
else
accel->key = _invKeycodeMap[key];

But possibly, this is not a good idea....

Maybe it is a good idea, to proove in the configure script
for such a bug in tolower....

so long
MUFTI

Discussion


Log in to post a comment.

MongoDB Logo MongoDB