8000
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 66645a2 commit e5c727eCopy full SHA for e5c727e
cores/arduino/Print.cpp
@@ -218,7 +218,7 @@ size_t Print::printNumber(unsigned long n, uint8_t base)
218
{
219
uint8_t *access = (uint8_t*) &n;
220
uint8_t written = 0;
221
- for (int8_t i=3; i>=0; i--) {
+ for (int8_t i=sizeof(unsigned long)-1; i>=0; i--) {
222
char c;
223
c = (access[i] & 0xf0) >> 4;
224
if (c != 0 || written != 0) {
@@ -238,7 +238,7 @@ size_t Print::printNumber(unsigned long n, uint8_t base)
238
239
240
241
242
if (access[i] == 0 && written == 0) {
243
// skip leading zeros
244
continue;
0 commit comments