Skip to content

Commit

Permalink
use strcmp instead of strcasecmp when comparing with number
Browse files Browse the repository at this point in the history
  • Loading branch information
toy committed Nov 14, 2020
1 parent 960c139 commit 10b583c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blueutil.m
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ void extend_optarg(int argc, char *argv[]) {
}

bool parse_state_arg(char *arg, enum state *state) {
if (0 == strcasecmp(arg, "1") || 0 == strcasecmp(arg, "on")) {
if (0 == strcmp(arg, "1") || 0 == strcasecmp(arg, "on")) {
*state = on;
return true;
}

if (0 == strcasecmp(arg, "0") || 0 == strcasecmp(arg, "off")) {
if (0 == strcmp(arg, "0") || 0 == strcasecmp(arg, "off")) {
*state = off;
return true;
}
Expand Down

0 comments on commit 10b583c

Please sign in to comment.