| 114 | } |
| 115 | |
| 116 | char *strbuf_free_to_string(strbuf_t *s, int *len) |
| 117 | { |
| 118 | char *buf; |
| 119 | |
| 120 | debug_stats(s); |
| 121 | |
| 122 | strbuf_ensure_null(s); |
| 123 | |
| 124 | buf = s->buf; |
| 125 | if (len) |
| 126 | *len = s->length; |
| 127 | |
| 128 | if (s->dynamic) |
| 129 | free(s); |
| 130 | |
| 131 | return buf; |
| 132 | } |
| 133 | |
| 134 | static int calculate_new_size(strbuf_t *s, int len) |
| 135 | { |
nothing calls this directly
no test coverage detected