diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-06-24 23:27:06 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-06-24 23:27:06 +0000 |
commit | 1ad4ff1ca446fafb3abe9353a4048893dd3d9b77 (patch) | |
tree | fb063577e7a9e3846ecdf61459d1e018737e380f /src/tagstruct.c | |
parent | a1b59db7127f328820336837c8f9f215e923dc8d (diff) |
some fixes
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@36 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/tagstruct.c')
-rw-r--r-- | src/tagstruct.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tagstruct.c b/src/tagstruct.c index 47e17839..407440d3 100644 --- a/src/tagstruct.c +++ b/src/tagstruct.c @@ -34,7 +34,7 @@ struct tagstruct *tagstruct_new(const uint8_t* data, size_t length) { t->data = (uint8_t*) data; t->allocated = t->length = data ? length : 0; t->rindex = 0; - t->dynamic = !!data; + t->dynamic = !data; return t; } @@ -57,7 +57,7 @@ uint8_t* tagstruct_free_data(struct tagstruct*t, size_t *l) { static void extend(struct tagstruct*t, size_t l) { assert(t && t->dynamic); - if (t->allocated <= l) + if (l <= t->allocated) return; t->data = realloc(t->data, t->allocated = l+100); @@ -75,7 +75,7 @@ void tagstruct_puts(struct tagstruct*t, const char *s) { } void tagstruct_putu32(struct tagstruct*t, uint32_t i) { - assert(t && i); + assert(t); extend(t, 5); t->data[t->length] = TAG_U32; *((uint32_t*) (t->data+t->length+1)) = htonl(i); @@ -83,7 +83,7 @@ void tagstruct_putu32(struct tagstruct*t, uint32_t i) { } void tagstruct_putu8(struct tagstruct*t, uint8_t c) { - assert(t && c); + assert(t); extend(t, 2); t->data[t->length] = TAG_U8; *(t->data+t->length+1) = c; |