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)
200200
201201// Private Methods /////////////////////////////////////////////////////////////
202202
203- size_t Print::printNumber (unsigned long n, uint8_t base) {
203+ size_t Print::printNumber (unsigned long n, uint8_t base)
204+ {
204205 char buf[8 * sizeof (long ) + 1 ]; // Assumes 8-bit chars plus zero byte.
205206 char *str = &buf[sizeof (buf) - 1 ];
206207
@@ -210,9 +211,9 @@ size_t Print::printNumber(unsigned long n, uint8_t base) {
210211 if (base < 2 ) base = 10 ;
211212
212213 do {
213- unsigned long m = n;
214+ char c = n % base ;
214215 n /= base;
215- char c = m - base * n;
216+
216217 *--str = c < 10 ? c + ' 0' : c + ' A' - 10 ;
217218 } while (n);
218219
You can’t perform that action at this time.
0 commit comments