Skip to content

Commit

Permalink
reduce variable scope
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy committed Sep 25, 2021
1 parent a6095fc commit 33d7ba1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@ char * Helpers::ultostr(char * ptr, uint32_t value, const uint8_t base) {

*ptr = '\0';

unsigned long res = 0;

do {
res = value - base * (t = value / base);
unsigned long res = value - base * (t = value / base);
if (res < 10) {
*--ptr = '0' + res;
} else if ((res >= 10) && (res < 16)) {
} else if (res < 16) {
*--ptr = 'A' - 10 + res;
}
} while ((value = t) != 0);
Expand Down

0 comments on commit 33d7ba1

Please sign in to comment.