File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
hardware/arduino/sam/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 @@ -192,7 +192,8 @@ size_t Print::println(const Printable& x)
192192
193193// Private Methods /////////////////////////////////////////////////////////////
194194
195- size_t Print::printNumber (unsigned long n, uint8_t base) {
195+ size_t Print::printNumber (unsigned long n, uint8_t base)
196+ {
196197 char buf[8 * sizeof (long ) + 1 ]; // Assumes 8-bit chars plus zero byte.
197198 char *str = &buf[sizeof (buf) - 1 ];
198199
@@ -202,9 +203,9 @@ size_t Print::printNumber(unsigned long n, uint8_t base) {
202203 if (base < 2 ) base = 10 ;
203204
204205 do {
205- unsigned long m = n;
206+ char c = n % base ;
206207 n /= base;
207- char c = m - base * n;
208+
208209 *--str = c < 10 ? c + ' 0' : c + ' A' - 10 ;
209210 } while (n);
210211
You can’t perform that action at this time.
0 commit comments