From 2553e327e3a827537f9c86fddac304344b6e3367 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 9 Nov 2011 04:23:13 +0000 Subject: [PATCH] use non-'const char *' while building string to avoid warnings git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199611 13f79535-47bb-0310-9956-ffa450edef68 --- modules/aaa/mod_authn_socache.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/aaa/mod_authn_socache.c b/modules/aaa/mod_authn_socache.c index a11cf31617..317ce9f7bd 100644 --- a/modules/aaa/mod_authn_socache.c +++ b/modules/aaa/mod_authn_socache.c @@ -231,11 +231,13 @@ static const char *construct_key(request_rec *r, const char *context, /* handle "special" context values */ if (!strcmp(context, "directory")) { /* FIXME: are we at risk of this blowing up? */ + char *new_context; char *slash = strrchr(r->uri, '/'); - context = apr_palloc(r->pool, slash - r->uri + - strlen(r->server->server_hostname) + 1); - strcpy(context, r->server->server_hostname); - strncat(context, r->uri, slash - r->uri); + new_context = apr_palloc(r->pool, slash - r->uri + + strlen(r->server->server_hostname) + 1); + strcpy(new_context, r->server->server_hostname); + strncat(new_context, r->uri, slash - r->uri); + context = new_context; } else if (!strcmp(context, "server")) { context = r->server->server_hostname; -- 2.50.1