aboutsummaryrefslogtreecommitdiff
path: root/lib/string/itoa.c
blob: 5eefb376e849eba1812fa5fee52d0f9a508509eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "string.h"

char *
itoa(char *p, unsigned x)
{
  p += 3 * sizeof(int);
  *--p = 0;
  do {
    *--p = '0' + x % 10;
    x /= 10;
  } while (x);
  return p;
}