mfro0 / libcmini-examples

a few simple example programs to show how to deal with the libcmini library
2 stars 0 forks source link

vqt_name may fill the whole array of 32 chars #2

Closed th-otto closed 4 years ago

th-otto commented 4 years ago

In your calls to vqt_name(), the array is only 32 chars. The VDI does not neccarily terminate that with a traling '\0' if the fontname is 32 chars or longer, causing crashes:

DEBUG: (init_fontwindow):font 51="Wingdings 2 Regular" DEBUG: (init_fontwindow):font 52="Bitstream Vera Sans Mono Bold ObM´P\ק`cXצb°" DEBUG: (init_fontwindow):font 53="Palatino Linotype Italic"

The program displays some more garbled font names, then crashes.

Attached is a patch for this

vqt_name.patch.txt

Edit: see also binding in gemlib; it explicitly copies 33 chars (last one being a flag IIRC)

There are also some redraw problems with the font window, when i resize it in aranym:

Screenshot_20200516_142228

When i resize it, i can briefly see some text being printed at the edges, but shortly after the whole window is filled with a white background.

mfro0 commented 4 years ago

should be fixed with 52bcc0e . While at it, window scrolling was implemented as well. Thank you!