version 1.49, 2014/09/08 14:29:05 |
version 1.50, 2014/10/08 17:35:58 |
|
|
|
|
/* Expand the buffer and copy in the value. */ |
/* Expand the buffer and copy in the value. */ |
while (*len - *off < valuelen + 1) { |
while (*len - *off < valuelen + 1) { |
*buf = xrealloc(*buf, 2, *len); |
*buf = xreallocarray(*buf, 2, *len); |
*len *= 2; |
*len *= 2; |
} |
} |
memcpy(*buf + *off, value, valuelen); |
memcpy(*buf + *off, value, valuelen); |
|
|
while (*fmt != '\0') { |
while (*fmt != '\0') { |
if (*fmt != '#') { |
if (*fmt != '#') { |
while (len - off < 2) { |
while (len - off < 2) { |
buf = xrealloc(buf, 2, len); |
buf = xreallocarray(buf, 2, len); |
len *= 2; |
len *= 2; |
} |
} |
buf[off++] = *fmt++; |
buf[off++] = *fmt++; |
|
|
continue; |
continue; |
case '#': |
case '#': |
while (len - off < 2) { |
while (len - off < 2) { |
buf = xrealloc(buf, 2, len); |
buf = xreallocarray(buf, 2, len); |
len *= 2; |
len *= 2; |
} |
} |
buf[off++] = '#'; |
buf[off++] = '#'; |
|
|
s = format_lower[ch - 'a']; |
s = format_lower[ch - 'a']; |
if (s == NULL) { |
if (s == NULL) { |
while (len - off < 3) { |
while (len - off < 3) { |
buf = xrealloc(buf, 2, len); |
buf = xreallocarray(buf, 2, len); |
len *= 2; |
len *= 2; |
} |
} |
buf[off++] = '#'; |
buf[off++] = '#'; |