Skip to content

Commit

Permalink
Merge pull request #218 from liuming50/fix-some-string-comparing-issues
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
  • Loading branch information
troglobit authored Feb 7, 2022
2 parents 33b4540 + cfffcd4 commit 6ec1ab3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/initctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ static int show_status(char *arg)

for (svc = client_svc_iterator(1); svc; svc = client_svc_iterator(0)) {
svc_ident(svc, ident, sizeof(ident));
if (string_match(ident, arg))
if (string_compare(ident, arg))
num++;
if (string_case_compare(ident, arg))
exact++;
Expand Down Expand Up @@ -797,7 +797,7 @@ static int show_status(char *arg)
char *lvls;

svc_ident(svc, ident, sizeof(ident));
if (num && !string_match(ident, arg))
if (num && !string_compare(ident, arg))
continue;

printf("%-*d ", pw, svc->pid);
Expand Down Expand Up @@ -995,7 +995,7 @@ static int cmd_parse(int argc, char *argv[], struct cmd *command)
if (!cmd_cond(&command[i]))
continue;

if (!string_match(command[i].cmd, argv[0]))
if (!string_compare(command[i].cmd, argv[0]))
continue;

if (command[i].ctx)
Expand Down
2 changes: 1 addition & 1 deletion src/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ svc_t *svc_named_iterator(svc_t **iter, int first, char *cmd)
for (svc = svc_iterator(iter, first); svc; svc = svc_iterator(iter, 0)) {
char *name = svc->name;

if (!strncmp(name, cmd, strlen(name)))
if (string_compare(name, cmd))
return svc;
}

Expand Down

0 comments on commit 6ec1ab3

Please sign in to comment.