taviso / 123elf

A native port of Lotus 1-2-3 to Linux.
1.17k stars 59 forks source link

Editing oddities #45

Closed taviso closed 2 years ago

taviso commented 2 years ago

If you press F2 to edit a very long formula, then move around with the cursor keys, backspace and del don't always seem to work correctly. I think this is a termcap issue.

taviso commented 2 years ago

No - I think I know the problem, it's using memcpy() with overlapping ranges!

Somehow that worked okay on UNIX, but Linux is not so forgiving.

The fix is easy, it should have been using memmove() to do that.

taviso commented 2 years ago

Hmmm.....could I just replace all calls to memcpy with memmove?

There is a minor performance penalty, but 123 is already blazing fast 🔥 on modern systems, and It will eliminate all bugs like this that I haven't found yet...

Alright, I'm going to do it.