httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: svn commit: r992806 - in /httpd/httpd/trunk: ./ docs/manual/ docs/manual/mod/ include/ modules/loggers/ server/
Date Tue, 07 Sep 2010 06:18:53 GMT


On 09/06/2010 09:00 PM, Stefan Fritsch wrote:
> On Monday 06 September 2010, Ruediger Pluem wrote:
>>> +
>>> +    /*
>>> +     * The apr-util docs wrongly states encoded strings are not 0-terminated.
>>> +     * Let's be save and allocate an additional byte.
>>> +     */
>>> +    len = 1 + apr_base64_encode_len(sizeof(id));
>>> +    encoded = apr_palloc(r ? r->pool : c->pool, len);
>>> +    apr_base64_encode(encoded, (char *)&id, sizeof(id));
>>> +    encoded[11] = '\0'; /* omit last char which is always '=' */
>> Why 11 and not len?
> 
> I didn't want to depend on wether apr_base64_encode_len() includes
> the terminating \0 or not. But as I am APR committer now, too, I
> should probably fix the docs instead.
> 
> Besides, it would have been encoded[len-3] or encoded[len-2] which
> is IMHO even less readable than encoded[11].

Given your latest comment (that you do not need the '=') IMHO
encoded[len-3] or encoded[len-2] is more readable then encoded[11].

> 
> I have commited all your other suggestions.

Thanks.

Regards

RĂ¼diger


Mime
View raw message