summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-09-07 16:02:57 +0200
committerJo-Philipp Wich <jo@mein.io>2020-09-07 16:30:34 +0200
commit916a05516b05bd2c9fd42c730f9a859be9226716 (patch)
treebcc8740a56c157d31bae2a2c4e1a1aca5902efc3
parent5d43bdb0d19823592dddd5f27e203a54f63e1441 (diff)
main: fix segfault when passed source file is empty
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.c b/main.c
index de429ab..9850b81 100644
--- a/main.c
+++ b/main.c
@@ -235,7 +235,7 @@ main(int argc, char **argv)
}
}
- rv = parse(source, dumponly);
+ rv = source ? parse(source, dumponly) : 0;
out:
if (input && input != stdin)