X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3lock;a=blobdiff_plain;f=i3lock.c;h=945be9fa1cc4c5a8fb794c733a5a4edb2909fe8f;hp=208e4acba4ae5533d37b7bf7d5371ccef248923c;hb=698204a98784a73916e3de4827ca739e88532492;hpb=14667d8304382bb766ddbab5c58c2c81bfe16b6c diff --git a/i3lock.c b/i3lock.c index 208e4ac..945be9f 100644 --- a/i3lock.c +++ b/i3lock.c @@ -819,7 +819,7 @@ int main(int argc, char *argv[]) { #endif int curs_choice = CURS_NONE; int o; - int optind = 0; + int longoptind = 0; struct option longopts[] = { {"version", no_argument, NULL, 'v'}, {"nofork", no_argument, NULL, 'n'}, @@ -843,7 +843,7 @@ int main(int argc, char *argv[]) { errx(EXIT_FAILURE, "pw->pw_name is NULL.\n"); char *optstring = "hvnbdc:p:ui:teI:f"; - while ((o = getopt_long(argc, argv, optstring, longopts, &optind)) != -1) { + while ((o = getopt_long(argc, argv, optstring, longopts, &longoptind)) != -1) { switch (o) { case 'v': errx(EXIT_SUCCESS, "version " VERSION " © 2010 Michael Stapelberg"); @@ -894,7 +894,7 @@ int main(int argc, char *argv[]) { ignore_empty_password = true; break; case 0: - if (strcmp(longopts[optind].name, "debug") == 0) + if (strcmp(longopts[longoptind].name, "debug") == 0) debug_mode = true; break; case 'f':