{
char escape, lpref, ch;
unsigned long long v;
- unsigned int written, width;
- size_t len, ofs;
+ int written, width, len;
+ size_t ofs;
char outbuf[21];
const char *outstr;
outstr = fmt;
len = ofs - 1;
flush_str:
- while (width-- > len) {
- if (cb(state, " ", 1) != 0)
+ width -= len;
+ while (width > 0) {
+ /* Output pad in 16 byte blocks with the small block first. */
+ int pad_len = ((width - 1) & 15) + 1;
+ width -= pad_len;
+ written += pad_len;
+ if (cb(state, " ", pad_len) != 0)
return -1;
- written += 1;
}
if (cb(state, outstr, len) != 0)
return -1;