strbuf_append_fmt() should only be used when an upper bound * is known for the output string. */
| 200 | /* strbuf_append_fmt() should only be used when an upper bound |
| 201 | * is known for the output string. */ |
| 202 | void strbuf_append_fmt(strbuf_t *s, int len, const char *fmt, ...) |
| 203 | { |
| 204 | va_list arg; |
| 205 | int fmt_len; |
| 206 | |
| 207 | strbuf_ensure_empty_length(s, len); |
| 208 | |
| 209 | va_start(arg, fmt); |
| 210 | fmt_len = vsnprintf(s->buf + s->length, len, fmt, arg); |
| 211 | va_end(arg); |
| 212 | |
| 213 | if (fmt_len < 0) |
| 214 | die("BUG: Unable to convert number"); /* This should never happen.. */ |
| 215 | |
| 216 | s->length += fmt_len; |
| 217 | } |
| 218 | |
| 219 | /* strbuf_append_fmt_retry() can be used when the there is no known |
| 220 | * upper bound for the output string. */ |
nothing calls this directly
no test coverage detected