Garrett Rooney wrote:
[...]
>>> +    for (i = 0; i < sr->extensions->nelts; ++i) {
>>> +      ap_rprintf(r, "%d-%s\r\n", 250, ((char
>>> **)sr->extensions->nelts)[i]);
>>
>>
>>                                                                    ^^^^^
>>
>> That should be "elts", shouldn't it?
>>
> 
> Yes indeed, it should.  One of the problems with data structures that
> require casting in order to access what you've stored in them...  The
> version that Rian committed is slightly different, but still has the
> same problem.  I'd post a patch, but it's probably faster to fix it by
> hand than it is to detach a patch from an email and apply it.
> 
> Over in Subversion-land we have a couple of macros defined for dealing
> with apr arrays, they make it rather difficult to make this kind of
> mistake, and I'd love to see them in the main APR release, but the last
> time it was brought up I believe someone objected to their inclusion...

I don't object, it sounds like a bloody good idea to me.

-Paul

Reply via email to