Don't make assumptions on textentry contents beyond the first '\0'.

This commit is contained in:
oliverschmidt 2006-08-30 22:15:25 +00:00
parent 301c1f45cf
commit 62a48a4138

View File

@ -29,7 +29,7 @@
* *
* This file is part of the "ctk" console GUI toolkit for cc65 * This file is part of the "ctk" console GUI toolkit for cc65
* *
* $Id: ctk-conio-service.c,v 1.2 2006/08/13 14:08:43 oliverschmidt Exp $ * $Id: ctk-conio-service.c,v 1.3 2006/08/30 22:15:25 oliverschmidt Exp $
* *
*/ */
@ -163,8 +163,11 @@ draw_widget(struct ctk_widget *w,
w->widget.textentry.ypos == j) { w->widget.textentry.ypos == j) {
revers(0); revers(0);
cputcxy(xpos, ypos, '>'); cputcxy(xpos, ypos, '>');
c = 1;
for(i = 0; i < w->w; ++i) { for(i = 0; i < w->w; ++i) {
c = text[i + xscroll]; if(c != 0) {
c = text[i + xscroll];
}
revers(i == w->widget.textentry.xpos - xscroll); revers(i == w->widget.textentry.xpos - xscroll);
if(c == 0) { if(c == 0) {
cputc(' '); cputc(' ');