| 104 | } |
| 105 | |
| 106 | void strbuf_grow(struct strbuf *sb, size_t extra) |
| 107 | { |
| 108 | int new_buf = !sb->alloc; |
| 109 | size_t new_len = st_add3(sb->len, extra, 1); |
| 110 | if (new_buf) |
| 111 | sb->buf = NULL; |
| 112 | ALLOC_GROW(sb->buf, new_len, sb->alloc); |
| 113 | if (new_buf) |
| 114 | sb->buf[0] = '\0'; |
| 115 | } |
| 116 | |
| 117 | void strbuf_trim(struct strbuf *sb) |
| 118 | { |
no outgoing calls
no test coverage detected