Don't make assumtions on the content of the textentry text buffer beyond the first '\0'.
diff --git a/contiki-apple2/ctk/ctk-mousetext.c b/contiki-apple2/ctk/ctk-mousetext.c
index ce7c45a..cca2aba 100644
--- a/contiki-apple2/ctk/ctk-mousetext.c
+++ b/contiki-apple2/ctk/ctk-mousetext.c
@@ -29,7 +29,7 @@
*
* This file is part of the "ctk" console GUI toolkit for cc65
*
- * $Id: ctk-mousetext.c,v 1.20 2005/05/12 23:57:37 oliverschmidt Exp $
+ * $Id: ctk-mousetext.c,v 1.21 2006/05/28 20:38:48 oliverschmidt Exp $
*
*/
@@ -143,8 +143,11 @@
w->widget.textentry.ypos == j) {
revers(0);
cputcxy(xpos, ypos, '>');
+ c = 1;
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);
if(c == 0) {
cputc(' ');