File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
hardware/arduino/avr/cores/arduino Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -200,7 +200,8 @@ size_t Print::println(const Printable& x)
200
200
201
201
// Private Methods /////////////////////////////////////////////////////////////
202
202
203
- size_t Print::printNumber (unsigned long n, uint8_t base) {
203
+ size_t Print::printNumber (unsigned long n, uint8_t base)
204
+ {
204
205
char buf[8 * sizeof (long ) + 1 ]; // Assumes 8-bit chars plus zero byte.
205
206
char *str = &buf[sizeof (buf) - 1 ];
206
207
@@ -210,9 +211,9 @@ size_t Print::printNumber(unsigned long n, uint8_t base) {
210
211
if (base < 2 ) base = 10 ;
211
212
212
213
do {
213
- unsigned long m = n;
214
+ char c = n % base ;
214
215
n /= base;
215
- char c = m - base * n;
216
+
216
217
*--str = c < 10 ? c + ' 0' : c + ' A' - 10 ;
217
218
} while (n);
218
219
You can’t perform that action at this time.
0 commit comments