From: hwangcc23 Date: Thu, 22 Jun 2017 14:53:08 +0000 (+0800) Subject: i3-msg: Return an exit code upon missing -t arg X-Git-Tag: 4.14~21^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5362876b60ddecda43de07affc77ec8f13335512;p=i3%2Fi3 i3-msg: Return an exit code upon missing -t arg If getopt() returns '?' (option with a missing argument), exit the program with an error code rather than continuing the execution. Fix the issue #2804 (https://github.com/i3/i3/issues/2804). --- diff --git a/i3-msg/main.c b/i3-msg/main.c index 02e156a1..4bc3c149 100644 --- a/i3-msg/main.c +++ b/i3-msg/main.c @@ -180,6 +180,8 @@ int main(int argc, char *argv[]) { printf("i3-msg " I3_VERSION "\n"); printf("i3-msg [-s ] [-t ] \n"); return 0; + } else if (o == '?') { + exit(EXIT_FAILURE); } }