Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87384622 authored by Josh Gao's avatar Josh Gao Committed by android-build-merger
Browse files

Merge "adb: avoid sign extension of shell return code." am: b5ac15a9 am: a6397564

am: 3811ab5a

Change-Id: I334ee2c20a76a6a081b7b752d8e7ca558da3f1da
parents 514fc036 3811ab5a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -295,7 +295,10 @@ int read_and_dump(int fd, bool use_shell_protocol = false,
                    callback->OnStderr(buffer_ptr, length);
                    break;
                case ShellProtocol::kIdExit:
                    exit_code = protocol->data()[0];
                    // data() returns a char* which doesn't have defined signedness.
                    // Cast to uint8_t to prevent 255 from being sign extended to INT_MIN,
                    // which doesn't get truncated on Windows.
                    exit_code = static_cast<uint8_t>(protocol->data()[0]);
                    continue;
                default:
                    continue;