Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
asciphx committed Feb 17, 2023
1 parent 81ea7e2 commit 38d2a3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion i2a.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static _INLINE unsigned char _utoa(char* c, unsigned int i, unsigned char o) {
c[o++] = _c3DigitsLut[a + 1];
c[o++] = _c3DigitsLut[a + 2];
} else {
a *= 2;
a <<= 1;
c[o++] = _c2DigitsLut[a];
c[o++] = _c2DigitsLut[a + 1];
}
Expand Down
5 changes: 2 additions & 3 deletions itoa.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ extern "C" {
#endif
//not use, just for u64toa
_INLINE static unsigned char _utoa(char* c, unsigned int i, unsigned char o) {
//4294967295
if (i < 1000000) {
if (i < _cRadix4D) {
const unsigned int a = (i / _cRadix2D) << 1;
const unsigned int b = (i % _cRadix2D) << 1;
if (i > 999) c[o++] = _c2DigitsLut[a];
Expand Down Expand Up @@ -87,7 +86,7 @@ extern "C" {
c[o++] = _c3DigitsLut[a + 1];
c[o++] = _c3DigitsLut[a + 2];
} else {
a *= 2;
a <<= 1;
c[o++] = _c2DigitsLut[a];
c[o++] = _c2DigitsLut[a + 1];
}
Expand Down

0 comments on commit 38d2a3a

Please sign in to comment.