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)
192
192
193
193
// Private Methods /////////////////////////////////////////////////////////////
194
194
195
- size_t Print::printNumber (unsigned long n, uint8_t base) {
195
+ size_t Print::printNumber (unsigned long n, uint8_t base)
196
+ {
196
197
char buf[8 * sizeof (long ) + 1 ]; // Assumes 8-bit chars plus zero byte.
197
198
char *str = &buf[sizeof (buf) - 1 ];
198
199
@@ -202,9 +203,9 @@ size_t Print::printNumber(unsigned long n, uint8_t base) {
202
203
if (base < 2 ) base = 10 ;
203
204
204
205
do {
205
- unsigned long m = n;
206
+ char c = n % base ;
206
207
n /= base;
207
- char c = m - base * n;
208
+
208
209
*--str = c < 10 ? c + ' 0' : c + ' A' - 10 ;
209
210
} while (n);
210
211
You can’t perform that action at this time.
0 commit comments