mirror of
https://github.com/opentx/opentx.git
synced 2025-07-15 04:15:26 +03:00
Re #3255: strAppendUnsigned() was not working for numbers >= 0x80000000
This commit is contained in:
parent
19f392131c
commit
726e32731b
1 changed files with 3 additions and 3 deletions
|
@ -157,9 +157,9 @@ char * strAppendUnsigned(char * dest, uint32_t value, uint8_t digits, uint8_t ra
|
|||
}
|
||||
uint8_t idx = digits;
|
||||
while(idx > 0) {
|
||||
div_t qr = div(value, radix);
|
||||
dest[--idx] = (qr.rem >= 10 ? 'A'-10 : '0') + qr.rem;
|
||||
value = qr.quot;
|
||||
uint32_t rem = value % radix;
|
||||
dest[--idx] = (rem >= 10 ? 'A'-10 : '0') + rem;
|
||||
value /= radix;
|
||||
}
|
||||
dest[digits] = '\0';
|
||||
return &dest[digits];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue