aboutsummaryrefslogtreecommitdiffstats
path: root/noice.c
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2015-11-20 11:55:41 +0000
committersin <sin@2f30.org>2015-11-20 11:55:41 +0000
commit30ca80310aa805aee1e3501da6c6a27812855978 (patch)
treee1b882e10c43ca6fe4068c8f52d1e390a0192883 /noice.c
parentea0cce7b6390cab3ba7c16560f50e69322eb89fb (diff)
downloadnoice-30ca80310aa805aee1e3501da6c6a27812855978.tar.gz
Properly handle empty filters
Diffstat (limited to 'noice.c')
-rw-r--r--noice.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/noice.c b/noice.c
index c72417f..fa712ff 100644
--- a/noice.c
+++ b/noice.c
@@ -331,10 +331,11 @@ readln(void)
echo();
curs_set(TRUE);
+ memset(ln, 0, sizeof(ln));
getnstr(ln, sizeof(ln) - 1);
noecho();
curs_set(FALSE);
- return strdup(ln);
+ return strlen(ln) ? strdup(ln) : NULL;
}
/*
Un proyecto texto-plano.xyz