httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Jaillet" <christophe.jail...@wanadoo.fr>
Subject Cleanup in 'modules\aaa\mod_authnz_ldap.c'
Date Mon, 21 Nov 2005 20:59:16 GMT
Around line 865 in 'modules\aaa\mod_authnz_ldap.c', there is the following
sequence :

=====================================================
    /* Set all the values, or at least some sane defaults */
    if (sec->host) {
        char *p = apr_palloc(cmd->pool, strlen(sec->host) +
strlen(urld->lud_host) + 2);
        strcpy(p, urld->lud_host);
        strcat(p, " ");
        strcat(p, sec->host);
        sec->host = p;
   }
=====================================================

It can be shortened and speed-up by using the apr_pstrcat function :
=====================================================
    /* Set all the values, or at least some sane defaults */
    if (sec->host) {
        sec->host = apr_pstrcat(cmd->pool, urld->lud_host, " ", sec->host,
NULL);
   }
=====================================================

CJ




Mime
View raw message