Skip to content

Commit

Permalink
Always use non-empty arguments
Browse files Browse the repository at this point in the history
The client passes parameters to the server via "adb shell" arguments.

Use "-" instead of "" when no crop is specified to avoid empty
arguments, which are not handled the same way on all devices.

Fixed <#337>.
  • Loading branch information
rom1v committed Nov 16, 2018
1 parent d81729b commit 1e22ebc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static process_t execute_server(const char *serial,
max_size_string,
bit_rate_string,
tunnel_forward ? "true" : "false",
crop ? crop : "''",
crop ? crop : "-",
send_frame_meta ? "true" : "false",
};
return adb_execute(serial, cmd, sizeof(cmd) / sizeof(cmd[0]));
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/com/genymobile/scrcpy/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private static Options createOptions(String... args) {
}

private static Rect parseCrop(String crop) {
if (crop.isEmpty()) {
if ("-".equals(crop)) {
return null;
}
// input format: "width:height:x:y"
Expand Down

0 comments on commit 1e22ebc

Please sign in to comment.