Skip to content

Commit 08a81c4

Browse files
warmonkeyfpistm
authored andcommitted
fix: print(0ULL) output nothing
Fixes stm32duino#2545 Signed-off-by: warmonkey <luoshumymail@gmail.com>
1 parent c35b8ef commit 08a81c4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: cores/arduino/Print.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,12 @@ size_t Print::printULLNumber(unsigned long long n64, uint8_t base)
375375
uint8_t i = 0;
376376
uint8_t innerLoops = 0;
377377

378+
// Special case workaround https://github.com/arduino/ArduinoCore-API/issues/178
379+
if (n64 == 0) {
380+
write('0');
381+
return 1;
382+
}
383+
378384
// prevent crash if called with base == 1
379385
if (base < 2) {
380386
base = 10;

0 commit comments

Comments
 (0)