]> git.sur5r.net Git - i3/i3lock/commitdiff
Throw an error when specifying an invalid pointer argument (-p) (Thanks TrickSTer)
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 25 Sep 2011 12:26:51 +0000 (13:26 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 25 Sep 2011 12:26:51 +0000 (13:26 +0100)
i3lock.c

index 89505a89e063dd68f7217c1cd3baf811f3185189..3332f830eefab7ff95a3cc2fdba1800ec333c41a 100644 (file)
--- a/i3lock.c
+++ b/i3lock.c
@@ -386,9 +386,10 @@ int main(int argc, char *argv[]) {
         case 'p':
             if (!strcmp(optarg, "win")) {
                 curs_choice = CURS_WIN;
-            }
-            if (!strcmp(optarg, "default")) {
+            } else if (!strcmp(optarg, "default")) {
                 curs_choice = CURS_DEFAULT;
+            } else {
+                errx(1, "i3lock: Invalid pointer type given. Expected one of \"win\" or \"default\".\n");
             }
             break;
         default: