aboutsummaryrefslogtreecommitdiff
path: root/lib/fu.c
blob: 074007d91d8eb2f47a6296203aab74014e105bcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "../int_defs.h"

static char fu_buffer[7*12];
/* format up to 6 numbers */

char *fu(uint32t u) /*EXTRACT_INCL*/ {
  static char k=7;
  char *p = fu_buffer + 12*k;
  *--p = 0;
  do {
    *--p = '0' + (u%10);
    u /= 10;
  } while (u);
  if (--k == 1) k=7;
  return p;
}