From c905c882b40ed3e7164e8e76afa67ccd33a5df00 Mon Sep 17 00:00:00 2001 From: Richard Grenville Date: Tue, 11 Sep 2012 23:11:23 +0800 Subject: [PATCH] Bug fix: Segfault when encountering invalid long option I didn't read the documentation of getopt_long() carefully. --- src/compton.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compton.c b/src/compton.c index 9e1eef3..a281b31 100644 --- a/src/compton.c +++ b/src/compton.c @@ -2594,6 +2594,8 @@ main(int argc, char **argv) { { "shadow-green", required_argument, NULL, 0 }, { "shadow-blue", required_argument, NULL, 0 }, { "inactive-opacity-override", no_argument, NULL, 0 }, + // Must terminate with a NULL entry + { NULL, 0, NULL, 0 }, }; XEvent ev;