From 1ad4ff1ca446fafb3abe9353a4048893dd3d9b77 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 24 Jun 2004 23:27:06 +0000 Subject: some fixes git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@36 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/tagstruct.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/tagstruct.c') 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; -- cgit