aboutsummaryrefslogtreecommitdiff
path: root/lib/fu.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fu.c')
-rw-r--r--lib/fu.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/fu.c b/lib/fu.c
new file mode 100644
index 0000000..074007d
--- /dev/null
+++ b/lib/fu.c
@@ -0,0 +1,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;
+}