Archived
1
0
Fork 0

strbuf.c: Added strbuf_append_repeat function

This commit is contained in:
Henrik Hautakoski 2010-11-19 11:04:16 +01:00
parent 0416fea36a
commit f06a528ad0
3 changed files with 12 additions and 2 deletions

View file

@ -102,6 +102,14 @@ void strbuf_append_ch(strbuf_t *s, char ch) {
s->buf[s->len] = '\0';
}
void strbuf_append_repeat(strbuf_t *s, char ch, size_t len) {
strbuf_expand(s, len);
memset(s->buf + s->len, ch, len);
s->len += len;
s->buf[s->len] = '\0';
}
void strbuf_rchop(strbuf_t *s, char ch) {
int i;