Merge "Work around an angler bootloader bug."
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index 5745fb0..226f3ef 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -44,6 +44,7 @@
 #include <unistd.h>
 
 #include <base/parseint.h>
+#include <base/strings.h>
 #include <sparse/sparse.h>
 #include <ziparchive/zip_archive.h>
 
@@ -575,6 +576,9 @@
         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());