--- slock.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/slock.c b/slock.c index 283b04e..e9b050a 100644 --- a/slock.c +++ b/slock.c _AT_@ -298,15 +298,14 @@ main(int argc, char *argv[]) { Display *dpy; int s, nlocks, nscreens; - if (argc > 1 && !strncmp("-", argv[1], 1)) { - if ((argc == 2 && !strcmp("-v", argv[1])) || - (argc == 3 && !strcmp("-v", argv[1]) && !strcmp("--", argv[2]))) { + if (argv[1] && argv[1][0] == '-') { + if (argv[1][1] == 'v' && argv[1][2] == '\0' && + (argc == 2 || (argc == 3 && !strcmp(argv[2], "--")))) { fputs("slock-"VERSION"\n", stderr); return 0; - } else if (!strcmp("--", argv[1])) { - --argc; - ++argv; - } else + } else if (argv[1][1] == '-' && argv[1][2] == '\0') + --argc, ++argv; + else die("usage: slock [-v] [cmd [arg ...]]\n"); } -- 2.8.3Received on Sat Oct 29 2016 - 00:32:43 CEST
This archive was generated by hypermail 2.3.0 : Sat Oct 29 2016 - 00:36:15 CEST