108 {
109 char tmp[16];
110 char *tp = tmp;
111 int i;
112 uint32_t v = value;
113
114 while (v || tp == tmp) {
115 i = v % radix;
116 v = radix ? v / radix : 0;
117 if (i < 10)
118 *tp++ = i + '0';
119 else
120 *tp++ = i + 'a' - 10;
121 }
122
123 int len = tp - tmp;
124
125 while (tp > tmp)
126 *sp++ = *--tp;
127
128 return len;
129}