aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Zaytsev <alexey.zaytsev@gmail.com>2008-12-17 22:01:18 +0300
committerAlexey Zaytsev <alexey.zaytsev@gmail.com>2008-12-18 20:30:22 +0300
commitfef304c047ddf90c41726dc139f415c70d646019 (patch)
treece2811b99ce5d3b919315b1c58f1c2a41ebacce7
parent5e48e6b76709bd7f0d520054889884b1ad8fa24c (diff)
downloadsparse-fef304c047ddf90c41726dc139f415c70d646019.tar.gz
sparse-fef304c047ddf90c41726dc139f415c70d646019.tar.xz
sparse-fef304c047ddf90c41726dc139f415c70d646019.zip
Handle missing argument to -D.
Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
-rw-r--r--lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 965fbfb..8dadfa9 100644
--- a/lib.c
+++ b/lib.c
@@ -248,6 +248,10 @@ static char **handle_switch_D(char *arg, char **next)
{
const char *name = arg + 1;
const char *value = "1";
+
+ if (!*name || isspace(*name))
+ die("argument to `-D' is missing");
+
for (;;) {
char c;
c = *++arg;