+// fmt_ulong and fmt_long from libowfat {{{
+unsigned int fmt_ulong(char *dest,unsigned long i) {
+ register unsigned long len,tmp,len2;
+ /* first count the number of bytes needed */
+ for (len=1, tmp=i; tmp>9; ++len) tmp/=10;
+ if (dest)
+ for (tmp=i, dest+=len, len2=len+1; --len2; tmp/=10)
+ *--dest = (tmp%10)+'0';
+ return len;
+}
+
+unsigned int fmt_long(char *dest,long int i) {
+ if (i<0) {
+ if (dest) *dest++='-';
+ return fmt_ulong(dest,-i)+1;
+ } else
+ return fmt_ulong(dest,i);
+}
+// }}}
+