Commit graph

4 commits

Author SHA1 Message Date
Romain Vimont
5d6bd8f9cd Fix adb device ip parsing
The parser assumed that its input was a NUL-terminated string, but it
was not the case: it is just the raw output of "adb devices ip route".

In practice, it was harmless, since the output always ended with '\n'
(which was replaced by '\0' on truncation), but it was incorrect
nonetheless.

Always write a '\0' at the end of the buffer, and explicitly parse as a
NUL-terminated string. For that purpose, avoid the error-prone
sc_str_truncate() util function.
2022-02-06 14:30:07 +01:00
Romain Vimont
7810ca61b0 Move ADB code to adb/ 2022-02-04 08:39:10 +01:00
Romain Vimont
1fbc590b26 Fix memory leaks in tests
Tests were failing when run with ASAN enabled.
2021-12-31 10:49:22 +01:00
Romain Vimont
f609b406c9 Add function to find the device IP address
Parse the result of "adb shell ip route" to find the device IP address.

PR #2827 <https://github.com/Genymobile/scrcpy/pull/2827>
2021-11-29 20:39:03 +01:00