Skip to content

Commit 3c6bf0a

Browse files
authored
Print number as 0 '0' instead of empty string (openwch#189)
Fixes openwch#185
1 parent 7e416ab commit 3c6bf0a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cores/arduino/Print.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,12 @@ size_t Print::printULLNumber(unsigned long long n64, uint8_t base)
356356
uint8_t i = 0;
357357
uint8_t innerLoops = 0;
358358

359+
// Special case workaround https://github.com/arduino/ArduinoCore-API/issues/178
360+
if (n64 == 0) {
361+
write('0');
362+
return 1;
363+
}
364+
359365
// prevent crash if called with base == 1
360366
if (base < 2) {
361367
base = 10;

0 commit comments

Comments
 (0)