]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
fix crash in textbox SetText when topLines != 0
authorMichael Vogt <michael.vogt@ubuntu.com>
Thu, 17 Sep 2009 14:44:25 +0000 (16:44 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 17 Sep 2009 14:44:25 +0000 (16:44 +0200)
textbox.c

index 639c9a971772f7f1d9bab56b46eb5a5588292bec..ae84b74fadd9627c850e4e91e7e99a7248f1feb4 100644 (file)
--- a/textbox.c
+++ b/textbox.c
@@ -306,7 +306,7 @@ void newtTextboxSetText(newtComponent co, const char * text) {
        for (i = 0; i < tb->numLines; i++) 
            free(tb->lines[i]);
        free(tb->lines);
-       tb->linesAlloced = tb->numLines = 0;
+       tb->linesAlloced = tb->numLines = tb->topLine = 0;
     }
 
     expanded = expandTabs(text);