Skip to content

Commit ece6e68

Browse files
Fix Print::print(0ULL)
Fixes #1691 To be removed once upstream bug is fixed and core-api imported: arduino#178
1 parent e37df85 commit ece6e68

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

api/Print.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,12 @@ size_t Print::printULLNumber(unsigned long long n64, uint8_t base)
335335
uint8_t i = 0;
336336
uint8_t innerLoops = 0;
337337

338+
// Special case workaround https://github.com/arduino/ArduinoCore-API/issues/178
339+
if (n64 == 0) {
340+
write('0');
341+
return 1;
342+
}
343+
338344
// prevent crash if called with base == 1
339345
if (base < 2) base = 10;
340346

0 commit comments

Comments
 (0)