Assert "adb disconnect" is called with an argument
Calling "adb disconnect" without argument would disconnect every TCP/IP device. We must make sure scrcpy never does that.
This commit is contained in:
parent
f807131c0a
commit
6ca9825c0f
1 changed files with 2 additions and 3 deletions
|
@ -364,11 +364,10 @@ sc_adb_connect(struct sc_intr *intr, const char *ip_port, unsigned flags) {
|
|||
|
||||
bool
|
||||
sc_adb_disconnect(struct sc_intr *intr, const char *ip_port, unsigned flags) {
|
||||
assert(ip_port);
|
||||
const char *const adb_cmd[] = {"disconnect", ip_port};
|
||||
size_t len = ip_port ? ARRAY_LEN(adb_cmd)
|
||||
: ARRAY_LEN(adb_cmd) - 1;
|
||||
|
||||
sc_pid pid = sc_adb_execute(NULL, adb_cmd, len, flags);
|
||||
sc_pid pid = sc_adb_execute(NULL, adb_cmd, ARRAY_LEN(adb_cmd), flags);
|
||||
return process_check_success_intr(intr, pid, "adb disconnect", flags);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue