Don't make assumtions on the content of the textentry text buffer beyond the first '\0'.
diff --git a/contiki/ctk/ctk-conio-service.c b/contiki/ctk/ctk-conio-service.c
index f80bc18..75d082f 100644
--- a/contiki/ctk/ctk-conio-service.c
+++ b/contiki/ctk/ctk-conio-service.c
@@ -29,7 +29,7 @@
*
* This file is part of the "ctk" console GUI toolkit for cc65
*
- * $Id: ctk-conio-service.c,v 1.11 2005/05/05 20:54:16 oliverschmidt Exp $
+ * $Id: ctk-conio-service.c,v 1.12 2006/05/28 20:38:19 oliverschmidt Exp $
*
*/
@@ -163,8 +163,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(' ');