Skip to content

Commit

Permalink
Rename cmd to argv
Browse files Browse the repository at this point in the history
This is more explicit.

PR #2405 <#2405>

Signed-off-by: Romain Vimont <[email protected]>
  • Loading branch information
Wirtos authored and rom1v committed Jun 20, 2021
1 parent 710e80a commit fda3292
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions app/src/adb.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,23 @@ show_adb_err_msg(enum process_result err, const char *const argv[]) {

process_t
adb_execute(const char *serial, const char *const adb_cmd[], size_t len) {
const char *cmd[len + 4];
const char *argv[len + 4];
int i;
process_t process;
cmd[0] = get_adb_command();
argv[0] = get_adb_command();
if (serial) {
cmd[1] = "-s";
cmd[2] = serial;
argv[1] = "-s";
argv[2] = serial;
i = 3;
} else {
i = 1;
}

memcpy(&cmd[i], adb_cmd, len * sizeof(const char *));
cmd[len + i] = NULL;
enum process_result r = process_execute(cmd, &process);
memcpy(&argv[i], adb_cmd, len * sizeof(const char *));
argv[len + i] = NULL;
enum process_result r = process_execute(argv, &process);
if (r != PROCESS_SUCCESS) {
show_adb_err_msg(r, cmd);
show_adb_err_msg(r, argv);
return PROCESS_NONE;
}
return process;
Expand Down

0 comments on commit fda3292

Please sign in to comment.