diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 651492061..3b25a8296 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -580,6 +581,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());