The function parsing "ip route" output modifies the input buffer to tokenize in place. This must be mentioned in the function documentation.
Parse the result of "adb shell ip route" to find the device IP address. PR #2827 <https://github.com/Genymobile/scrcpy/pull/2827>