diff options
Diffstat (limited to 'src/pulsecore/strbuf.c')
-rw-r--r-- | src/pulsecore/strbuf.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/pulsecore/strbuf.c b/src/pulsecore/strbuf.c index ea8389f5..b59b6f49 100644 --- a/src/pulsecore/strbuf.c +++ b/src/pulsecore/strbuf.c @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of PulseAudio. @@ -55,13 +53,13 @@ pa_strbuf *pa_strbuf_new(void) { sb = pa_xnew(pa_strbuf, 1); sb->length = 0; sb->head = sb->tail = NULL; - + return sb; } void pa_strbuf_free(pa_strbuf *sb) { pa_assert(sb); - + while (sb->head) { struct chunk *c = sb->head; sb->head = sb->head->next; @@ -76,7 +74,7 @@ void pa_strbuf_free(pa_strbuf *sb) { char *pa_strbuf_tostring(pa_strbuf *sb) { char *t, *e; struct chunk *c; - + pa_assert(sb); e = t = pa_xnew(char, sb->length+1); @@ -98,20 +96,20 @@ char *pa_strbuf_tostring(pa_strbuf *sb) { /* Combination of pa_strbuf_free() and pa_strbuf_tostring() */ char *pa_strbuf_tostring_free(pa_strbuf *sb) { char *t; - + pa_assert(sb); t = pa_strbuf_tostring(sb); pa_strbuf_free(sb); - + return t; } /* Append a string to the string buffer */ void pa_strbuf_puts(pa_strbuf *sb, const char *t) { - + pa_assert(sb); pa_assert(t); - + pa_strbuf_putsn(sb, t, strlen(t)); } @@ -136,7 +134,7 @@ static void append(pa_strbuf *sb, struct chunk *c) { /* Append up to l bytes of a string to the string buffer */ void pa_strbuf_putsn(pa_strbuf *sb, const char *t, size_t l) { struct chunk *c; - + pa_assert(sb); pa_assert(t); |