mirror of
https://github.com/jarun/nnn.git
synced 2025-01-24 01:36:53 +00:00
Get rid of redundant buffer
This commit is contained in:
parent
d803521c6d
commit
fb4728bc31
|
@ -537,12 +537,11 @@ static uint xatoi(const char *str)
|
||||||
|
|
||||||
static char *xitoa(uint val)
|
static char *xitoa(uint val)
|
||||||
{
|
{
|
||||||
const char hexbuf[] = "0123456789";
|
|
||||||
static char ascbuf[32] = {0};
|
static char ascbuf[32] = {0};
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 30; val && i; --i, val /= 10)
|
for (i = 30; val && i; --i, val /= 10)
|
||||||
ascbuf[i] = hexbuf[val % 10];
|
ascbuf[i] = '0' + (val % 10);
|
||||||
|
|
||||||
return &ascbuf[++i];
|
return &ascbuf[++i];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue