On 10 Aug 2001 [EMAIL PROTECTED] wrote:

>   +/**
>   + * Remove all zero length buckets from the brigade.
>   + * @param b The bucket brigade
>   + */
>   +#define APR_BRIGADE_NORMALIZE(b)       \
>   +    do {  \
>   +        apr_bucket *e; \
>   +        e = APR_BRIGADE_FIRST(b); \
>   +        if (e->length == 0) { \
>   +            apr_bucket *d; \
>   +            d = APR_BUCKET_NEXT(e); \
>   +            apr_bucket_delete(e); \
>   +            e = d; \
>   +        } \
>   +        e = APR_BUCKET_NEXT(e); \
>   +    } while (e != APR_BRIGADE_SENTINEL(b))
>   +
>    /*
>     * General-purpose reference counting for the various bucket types.
>     *

What if you call this on a brigade that's already empty?  You'll probably
segfault.  You should move the while test up to the top of the loop, I
think.

--Cliff

--------------------------------------------------------------
   Cliff Woolley
   [EMAIL PROTECTED]
   Charlottesville, VA


Reply via email to