Append to growable string */
| 50 | |
| 51 | /* Append to growable string */ |
| 52 | void str_append(struct gstr *gs, const char *s) |
| 53 | { |
| 54 | size_t l; |
| 55 | if (s) { |
| 56 | l = strlen(gs->s) + strlen(s) + 1; |
| 57 | if (l > gs->len) { |
| 58 | gs->s = xrealloc(gs->s, l); |
| 59 | gs->len = l; |
| 60 | } |
| 61 | strcat(gs->s, s); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | /* Append printf formatted string to growable string */ |
| 66 | void str_printf(struct gstr *gs, const char *fmt, ...) |
no test coverage detected