Browse Source

Fix xitoa()

master
Arun Prakash Jana 5 years ago
parent
commit
9988d254fe
No known key found for this signature in database GPG Key ID: A75979F35C080412
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      src/nnn.c

+ 5
- 2
src/nnn.c View File

@@ -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…
Cancel
Save