We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f174e4 commit d7eb313Copy full SHA for d7eb313
src/fastboot.ts
@@ -384,15 +384,9 @@ export class FastbootDevice {
384
"max-download-size"
385
))!.toLowerCase();
386
if (resp) {
387
- let size
388
- try {
389
- // Some bootloaders return decimal
390
- size = parseInt(resp, 10)
391
- } catch (e) {
392
- // Some bootloaders return hex
393
- size = parseInt(resp, 16)
394
- }
395
- return Math.min(size, MAX_DOWNLOAD_SIZE);
+ // Some bootloaders return hex, some return decimal
+ // parseInt handles both by detecting the "0x" prefix
+ return Math.min(parseInt(resp), MAX_DOWNLOAD_SIZE);
396
}
397
} catch (error) {
398
/* Failed = no value, fallthrough */
0 commit comments