From: Michael Stapelberg Date: Sun, 25 Sep 2011 12:26:51 +0000 (+0100) Subject: Throw an error when specifying an invalid pointer argument (-p) (Thanks TrickSTer) X-Git-Tag: 2.2~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5932ee24a72e508875d094f4197d48d12085f872;p=i3%2Fi3lock Throw an error when specifying an invalid pointer argument (-p) (Thanks TrickSTer) --- diff --git a/i3lock.c b/i3lock.c index 89505a8..3332f83 100644 --- 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: