From 77c0e66bef637aa749c5618e2bdec1c829f79e58 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 2 Nov 2015 15:51:12 -0800 Subject: [PATCH] Work around an angler bootloader bug. It's probably not the only device whose bootloader is similarly broken. NVIDIA did a sufficiently good job with Nexus 9 that it's almost a bad idea for me to do most of my development there... Change-Id: I71436cc5c33023be077ca77f6dad5dbe75b11b09 --- fastboot/fastboot.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 5745fb0a4..226f3effe 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -575,6 +576,9 @@ static int64_t get_target_sparse_limit(usb_handle* usb) { return 0; } + // Some bootloaders (angler, for example) send spurious whitespace too. + max_download_size = android::base::Trim(max_download_size); + uint64_t limit; if (!android::base::ParseUint(max_download_size.c_str(), &limit)) { fprintf(stderr, "couldn't parse max-download-size '%s'\n", max_download_size.c_str());