Skip to content

Commit

Permalink
Fix Print::print(0ULL)
Browse files Browse the repository at this point in the history
Fixes #1691

To be removed once upstream bug is fixed and core-api imported:
#178
  • Loading branch information
earlephilhower authored and aentinger committed Sep 4, 2023
1 parent 8ce59d2 commit 754aa9b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ size_t Print::printULLNumber(unsigned long long n64, uint8_t base)
uint8_t i = 0;
uint8_t innerLoops = 0;

// Special case workaround https://github.com/arduino/ArduinoCore-API/issues/178
if (n64 == 0) {
write('0');
return 1;
}

// prevent crash if called with base == 1
if (base < 2) base = 10;

Expand Down

0 comments on commit 754aa9b

Please sign in to comment.