mirror of
https://github.com/jarun/nnn.git
synced 2025-01-22 08:46:38 +00:00
Fix xitoa()
This commit is contained in:
parent
1baf284369
commit
9988d254fe
|
@ -536,9 +536,12 @@ static uint xatoi(const char *str)
|
|||
static char *xitoa(uint val)
|
||||
{
|
||||
static char ascbuf[32] = {0};
|
||||
int i;
|
||||
int i = 30;
|
||||
|
||||
for (i = 30; val && i; --i, val /= 10)
|
||||
if (!val)
|
||||
return "0";
|
||||
|
||||
for (; val && i; --i, val /= 10)
|
||||
ascbuf[i] = '0' + (val % 10);
|
||||
|
||||
return &ascbuf[++i];
|
||||
|
|
Loading…
Reference in a new issue