Rename cmd to argv
This is more explicit. PR #2405 <https://github.com/Genymobile/scrcpy/pull/2405> Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
parent
710e80aa0d
commit
fda32928c1
1 changed files with 8 additions and 8 deletions
|
@ -102,23 +102,23 @@ show_adb_err_msg(enum process_result err, const char *const argv[]) {
|
||||||
|
|
||||||
process_t
|
process_t
|
||||||
adb_execute(const char *serial, const char *const adb_cmd[], size_t len) {
|
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;
|
int i;
|
||||||
process_t process;
|
process_t process;
|
||||||
cmd[0] = get_adb_command();
|
argv[0] = get_adb_command();
|
||||||
if (serial) {
|
if (serial) {
|
||||||
cmd[1] = "-s";
|
argv[1] = "-s";
|
||||||
cmd[2] = serial;
|
argv[2] = serial;
|
||||||
i = 3;
|
i = 3;
|
||||||
} else {
|
} else {
|
||||||
i = 1;
|
i = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&cmd[i], adb_cmd, len * sizeof(const char *));
|
memcpy(&argv[i], adb_cmd, len * sizeof(const char *));
|
||||||
cmd[len + i] = NULL;
|
argv[len + i] = NULL;
|
||||||
enum process_result r = process_execute(cmd, &process);
|
enum process_result r = process_execute(argv, &process);
|
||||||
if (r != PROCESS_SUCCESS) {
|
if (r != PROCESS_SUCCESS) {
|
||||||
show_adb_err_msg(r, cmd);
|
show_adb_err_msg(r, argv);
|
||||||
return PROCESS_NONE;
|
return PROCESS_NONE;
|
||||||
}
|
}
|
||||||
return process;
|
return process;
|
||||||
|
|
Loading…
Reference in a new issue