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

This commit is contained in:
oliverschmidt 2006-09-09 23:09:59 +00:00
parent 63c431a271
commit 8a8575b63c

View file

@ -30,7 +30,7 @@
* *
* Author: Adam Dunkels <adam@sics.se> * Author: Adam Dunkels <adam@sics.se>
* *
* $Id: ctk-80col.c,v 1.1 2006/06/17 22:41:26 adamdunkels Exp $ * $Id: ctk-80col.c,v 1.2 2006/09/09 23:09:59 oliverschmidt Exp $
*/ */
#include "contiki.h" #include "contiki.h"
@ -697,8 +697,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];
}
if(i == w->widget.textentry.xpos - xscroll) { if(i == w->widget.textentry.xpos - xscroll) {
revers(1); revers(1);
} else { } else {