]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
handle NULL initial value
authorewt <ewt>
Wed, 18 Feb 1998 19:29:21 +0000 (19:29 +0000)
committerewt <ewt>
Wed, 18 Feb 1998 19:29:21 +0000 (19:29 +0000)
entry.c

diff --git a/entry.c b/entry.c
index 12f22e3621f46f3973acbaa686e2e57ce88cd31d..407266e5d3030c1ea2570f18a59412c36869b5f5 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -91,6 +91,10 @@ newtComponent newtEntry(int left, int top, const char * initialValue, int width,
        strcpy(en->buf, initialValue);
        en->bufUsed = strlen(initialValue);
        en->cursorPosition = en->bufUsed;
+    } else {
+       *en->buf = '\0';
+       en->bufUsed = 0;
+       en->cursorPosition = 0;
     }
 
     return co;