[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] typo in keyboard.c



Am 23.05.2010, 12:45 Uhr, schrieb Alan Hourihane <alanh@fairlite.co.uk>:

On Sun, 2010-05-23 at 11:21 +0100, Alan Hourihane wrote:
On Sun, 2010-05-23 at 09:22 +0200, Helmut Karlowski wrote:
> There's a typo in line 160 in keyboard.c:
>
> static char makes[MAKES_BLEN + 1 * 2];
>
> should be:
>
> static char makes[MAKES_BLEN * 2 + 1];
>
> or even:
>
> static char makes[MAKES_BLEN * 2 - 1];
>
> This may cause severe problems. I recommend not to use kernels with this
> error.
>
> There is a good chance that this also causes eiffel-bug.
>
> I've committed the fix to my branch.

Helmut,

I've pulled in this fix and I agree it could cause some unwanted
behaviour, but where is the makes[] structure actually used ?

It seems to be filled in during ikbd_scan(), but I can't see where
makes[] is actually used anywhere else to make use of that data ?

Seems to me as though it was a partial bit of code that never gets used.
And in fact removing it cleans up a few ifdefs from the MILAN code.

Attached patch.

Currently I don't know completely how this all works, but the subscript of makes clearly exceeds 19, and kbd_lock gets overwritten: It has values that depend on the typed key.

Does makes[] still have to be 33 bytes long with your patch?

Another issue: what if bioskeys crashes (like it did when calling swkbdtbl) and kbd_lock is never reset? The idea to do this in ikbd_scan is surely not a perfect solution.

--
Helmut Karlowski