Archived
1
0
Fork 0

docs for strbuf and some small changes.

This commit is contained in:
H Hautakoski 2010-08-06 11:31:04 +02:00 committed by Henrik Hautakoski
parent d6537b235c
commit f1dbd880a7
6 changed files with 79 additions and 6 deletions

View file

@ -47,6 +47,15 @@ void strbuf_append(strbuf_t *s, char *str, size_t len) {
s->buf[s->len] = '\0';
}
void strbuf_reduce(strbuf_t *s, size_t len) {
if (len > s->len)
len = s->len;
s->len -= len;
s->buf[s->len] = '\0';
}
void strbuf_trim(strbuf_t *s) {
strbuf_rtrim(s);