- ksprintf(&str, "\t%c%c:", key[0], key[1]);
- if (type == 'A') { ksprintf(&str, "A:%c", *s); ++s; }
- else if (type == 'C') { ksprintf(&str, "i:%u", *s); ++s; }
- else if (type == 'c') { ksprintf(&str, "i:%d", *s); ++s; }
- else if (type == 'S') { ksprintf(&str, "i:%u", *(uint16_t*)s); s += 2; }
- else if (type == 's') { ksprintf(&str, "i:%d", *(int16_t*)s); s += 2; }
- else if (type == 'I') { ksprintf(&str, "i:%u", *(uint32_t*)s); s += 4; }
- else if (type == 'i') { ksprintf(&str, "i:%d", *(int32_t*)s); s += 4; }
+ kputc('\t', &str); kputsn((char*)key, 2, &str); kputc(':', &str);
+ if (type == 'A') { kputsn("A:", 2, &str); kputc(*s, &str); ++s; }
+ else if (type == 'C') { kputsn("i:", 2, &str); kputw(*s, &str); ++s; }
+ else if (type == 'c') { kputsn("i:", 2, &str); kputw(*(int8_t*)s, &str); ++s; }
+ else if (type == 'S') { kputsn("i:", 2, &str); kputw(*(uint16_t*)s, &str); s += 2; }
+ else if (type == 's') { kputsn("i:", 2, &str); kputw(*(int16_t*)s, &str); s += 2; }
+ else if (type == 'I') { kputsn("i:", 2, &str); kputuw(*(uint32_t*)s, &str); s += 4; }
+ else if (type == 'i') { kputsn("i:", 2, &str); kputw(*(int32_t*)s, &str); s += 4; }