fmt_uint0.c
author tomas@localhost
Thu, 01 Nov 2007 14:46:11 +0100
changeset 0 c045670f36e9
permissions -rw-r--r--
Imported queue-fix-1.4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     1
#include "fmt.h"
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     2
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     3
unsigned int fmt_uint0(s,u,n) char *s; unsigned int u; unsigned int n;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     4
{
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     5
  unsigned int len;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     6
  len = fmt_uint(FMT_LEN,u);
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     7
  while (len < n) { if (s) *s++ = '0'; ++len; }
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     8
  if (s) fmt_uint(s,u);
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     9
  return len;
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    10
}