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(' ');
diff --git a/contiki/ctk/ctk-conio.c b/contiki/ctk/ctk-conio.c
index e25d09c..2f8399b 100644
--- a/contiki/ctk/ctk-conio.c
+++ b/contiki/ctk/ctk-conio.c
@@ -29,7 +29,7 @@
*
* This file is part of the "ctk" console GUI toolkit for cc65
*
- * $Id: ctk-conio.c,v 1.23 2005/05/05 20:54:16 oliverschmidt Exp $
+ * $Id: ctk-conio.c,v 1.24 2006/05/28 20:38:19 oliverschmidt Exp $
*
*/
@@ -162,8 +162,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(' ');
diff --git a/contiki/ctk/ctk-term.c b/contiki/ctk/ctk-term.c
index c731440..cd9bbfe 100644
--- a/contiki/ctk/ctk-term.c
+++ b/contiki/ctk/ctk-term.c
@@ -474,8 +474,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];
+ }
if(i == w->widget.textentry.xpos - xscroll) {
textcolor((unsigned char)(TERM_TEXTENTRYCOLOR + (focus ^ 0x01)));
revers(1);
diff --git a/contiki/ctk/ctk-vncserver.c b/contiki/ctk/ctk-vncserver.c
index 856e9eb..74ba31f 100644
--- a/contiki/ctk/ctk-vncserver.c
+++ b/contiki/ctk/ctk-vncserver.c
@@ -41,7 +41,7 @@
*
* This file is part of the "ctk" console GUI toolkit for cc65
*
- * $Id: ctk-vncserver.c,v 1.16 2005/05/05 20:54:16 oliverschmidt Exp $
+ * $Id: ctk-vncserver.c,v 1.17 2006/05/28 20:38:19 oliverschmidt Exp $
*
*/
@@ -429,8 +429,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];
+ }
if(i == w->widget.textentry.xpos - xscroll) {
textcolor(VNC_OUT_TEXTENTRYCOLOR + (focus ^ 0x01));
revers(1);