Skip to content

Commit

Permalink
changing has_command()
Browse files Browse the repository at this point in the history
  • Loading branch information
PumpkinXD committed Mar 23, 2024
1 parent 39f47f8 commit ae1f8ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plat/unspecified/detect_unknown.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ int has_command(const char *cmd) {
FILE *fp;
int status;

size_t cmd_len = strlen(cmd) + strlen(" --version")+1;
size_t cmd_len = strlen(cmd) + strlen("command -v ")+1;
char *cmd_line = malloc(cmd_len);
if (cmd_line == NULL) {
perror("malloc");
return -1;
}
snprintf(cmd_line, cmd_len, "%s --version", cmd);
snprintf(cmd_line, cmd_len, "command -v %s", cmd);

fp = popen(cmd_line, "r");
// printf("%s\n",cmd_line);
Expand Down

0 comments on commit ae1f8ad

Please sign in to comment.