Hi,
in the 2 functions below, you could also use apr_pstrcat instead of a
hard coded (20) for extra space needed by '[', ']', ... +
apr_pcalloc/strlen/strcpy/strcat
This is cleaner, IMHO and less verbose (and faster but we don't really
care here).
CJ
Le 19/08/2015 16:55, ic...@apache.org a écrit :
Author: icing
Date: Wed Aug 19 14:55:26 2015
New Revision: 1696607
Modified: httpd/httpd/trunk/modules/http2/h2_config.c
URL:
http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_config.c?rev=1696607&r1=1696606&r2=1696607&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_config.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_config.c Wed Aug 19 14:55:26 2015
@@ -58,7 +58,7 @@ static void *h2_config_create(apr_pool_t
h2_config *conf = (h2_config *)apr_pcalloc(pool, sizeof(h2_config));
const char *s = x? x : "unknown";
- char *name = (char *)apr_pcalloc(pool, strlen(prefix) + strlen(s) + 20);
+ char *name = apr_pcalloc(pool, strlen(prefix) + strlen(s) + 20);
strcpy(name, prefix);
strcat(name, "[");
strcat(name, s);
@@ -97,8 +97,7 @@ void *h2_config_merge(apr_pool_t *pool,
h2_config *add = (h2_config *)addv;
h2_config *n = (h2_config *)apr_pcalloc(pool, sizeof(h2_config));
- char *name = (char *)apr_pcalloc(pool,
- 20 + strlen(add->name) + strlen(base->name));
+ char *name = apr_pcalloc(pool, 20 + strlen(add->name) +
strlen(base->name));
strcpy(name, "merged[");
strcat(name, add->name);
strcat(name, ", ");