| [AD] excustom change + d_edit_proc |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
The attached patch moves the font change code from exgui to excustom,
and also fixes the d_edit_proc overflow in it.
I found the old thread about d1 in the archives, with ideas like using
negative numbers for max_chars, or a pointer to a triplet of {max_chars,
max_bytes, max_pixels} - but apparently no idea was considered to work
very good - therefore I propose to add this note to the docs for now:
--- allegro._tx 26 May 2003 22:23:04 -0000 1.157
+++ allegro._tx 30 May 2003 14:15:20 -0000
@@ -7684,6 +7684,10 @@
typed into this object. The d1 field specifies the maximum number of
characters that it will accept, and d2 is the text cursor position within
the string.
+
+ Note: dp must point to a buffer at least (d1 + 1) * 6 bytes long. This is
+ due to the fact that - depending on the encoding - one character can have
+ up to 6 bytes, and you also need room for the terminator character.
@@int @d_list_proc(int msg, DIALOG *d, int c);
@eref exgui
--
Elias Pschernig <elias@xxxxxxxxxx>
Attachment:
excustom.diff.gz
Description: GNU Zip compressed data
| Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |