]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
fix isMapped initialization and check in label
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 17 Sep 2009 15:30:11 +0000 (17:30 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 17 Sep 2009 15:30:11 +0000 (17:30 +0200)
label.c

diff --git a/label.c b/label.c
index a0c17a4a391fb1e623327e12b7f4e40816bb9e8a..bc9e510f09748e205e4ba31334bc3ea5a350894c 100644 (file)
--- a/label.c
+++ b/label.c
@@ -37,6 +37,7 @@ newtComponent newtLabel(int left, int top, const char * text) {
     co->top = top;
     co->left = left;
     co->takesFocus = 0;
+    co->isMapped = 0;
 
     la->length = strlen(text);
     la->text = strdup(text);
@@ -65,7 +66,7 @@ void newtLabelSetText(newtComponent co, const char * text) {
 static void labelDraw(newtComponent co) {
     struct label * la = co->data;
 
-    if (co->isMapped == -1) return;
+    if (!co->isMapped) return;
 
     SLsmg_set_color(COLORSET_LABEL);