Skip to content

Commit

Permalink
Fix crash when display is not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
p00ya committed Apr 4, 2020
1 parent 6b0d5fe commit 3a572b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions displaymode.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <MacTypes.h>

// Name and version to display with "v" option.
const char kProgramVersion[] = "displaymode 1.3.0";
const char kProgramVersion[] = "displaymode 1.3.1";

// States for the main invocation "option".
//
Expand Down Expand Up @@ -91,7 +91,7 @@ void ParseMode(const int argc, const char * argv[],
parsed_args->option = kOptionInvalidMode;
}

if (kArgvDisplayIndex <= argc) {
if (kArgvDisplayIndex < argc) {
parsed_args->display_index =
(uint32_t) strtoul(argv[kArgvDisplayIndex], NULL, 10);
if (errno != 0) {
Expand Down

0 comments on commit 3a572b2

Please sign in to comment.