iaia
public text v1 · immutableunsigned char
*encode_field(unsigned int field)
{
unsigned char buf[4];
static unsigned char s[3] = {0};
if (field > 99) {
snprintf(buf, 4, "%d", field);
s[0] = (field/10) + (field > 199 ? 60 : 54);
s[1] = buf[2];
} else {
snprintf(s, 3, "%d", field);
}
return s;
}