We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a73e50d commit dd6890aCopy full SHA for dd6890a
cores/arduino/Print.cpp
@@ -188,7 +188,8 @@ size_t Print::println(const Printable& x)
188
189
// Private Methods /////////////////////////////////////////////////////////////
190
191
-size_t Print::printNumber(unsigned long n, uint8_t base) {
+size_t Print::printNumber(unsigned long n, uint8_t base)
192
+{
193
char buf[8 * sizeof(long) + 1]; // Assumes 8-bit chars plus zero byte.
194
char *str = &buf[sizeof(buf) - 1];
195
@@ -198,9 +199,9 @@ size_t Print::printNumber(unsigned long n, uint8_t base) {
198
199
if (base < 2) base = 10;
200
201
do {
- unsigned long m = n;
202
+ char c = n % base;
203
n /= base;
- char c = m - base * n;
204
+
205
*--str = c < 10 ? c + '0' : c + 'A' - 10;
206
} while(n);
207
0 commit comments