mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-29 00:11:16 +01:00
Merge pull request #4426 from kaspar030/fix_fmt_u32_dec_zero_case
sys: fmt: fix converting "0" in fmt_u32_dec()
This commit is contained in:
commit
6a473e6cc2
@ -93,10 +93,9 @@ size_t fmt_u32_dec(char *out, uint32_t val)
|
||||
|
||||
if (out) {
|
||||
char *ptr = out + len;
|
||||
while(val) {
|
||||
do {
|
||||
*--ptr = (val % 10) + '0';
|
||||
val /= 10;
|
||||
}
|
||||
} while ((val /= 10));
|
||||
}
|
||||
|
||||
return len;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user