CDK bug-fixing

One should think that console-based applications are common under Linux, as on any other *NIX-like OS. Furthermore, one would assume that there is at least one, if not a variety of curses-based widget toolkits available.

The largest such project seems to be CDK (Curses Development Kit), so I choose it for the GSPC software.

Apparently, CDK isn't used that frequently either - otherwise it would be impossible for me to find that many bugs, even without trying to do something wicked. Let's say you want to add an item to a scrolled list... and after adding about 8 items, the toolkit segfaults. It turns out the list items are dynamically allocated, but only reallocated if you replace all of them (as opposed to just adding a single one).

Or let's say you want the "END" key to work in such a scrolled list, independent if there are less, equal or more items than fitting in your viewport.

So Unix is supposed to be the text-oriented world, and still there are way more (and more stable) widget toolkits for X11 than there are for text mode. *sigh*