httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kraemer <martin.krae...@mch.sni.de>
Subject Re: [PATCH] Default ordering for FancyIndexed directories
Date Wed, 30 Dec 1998 11:24:42 GMT
> +{
> +    char temp[4] = {'x', '=', 'x', '\0'};

While I'm +1 on concept for this new directive (one of my clients already
asked for it), this initialisation isn't accepted by some of the compilers
I have at hand here. Can it be changed to either char *temp = "?=?", or
initialized in code (ap_cpystrn(temp,"?=?", sizeof temp)), or to
a static array (threads beware!)?

Sorry for being so conservative ;-)

> +    if (d_cfg->default_order == NULL) {
> +	d_cfg->default_order = ap_palloc(cmd->pool, 5);
> +	d_cfg->default_order[4] = '\0';
> +    }
Why 5? temp[] is only 4 bytes (including nil)!

> +    strcpy(d_cfg->default_order, temp);
> +    return NULL;
> +}
You probably avoided ap_cpystrn() because the size is known
beforehand. Nevertheless....
The rest looks good.

And a happy new year to everyone!

    Martin
-- 
<Martin.Kraemer@Mch.SNI.De>      |        Siemens Information and
Phone: +49-89-636-46021          |        Communication  Products
FAX:   +49-89-636-47816          |        81730  Munich,  Germany

Mime
View raw message