Skip to content

Commit e4c7cb7

Browse files
committed
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
1 parent ae3f4ed commit e4c7cb7

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

modules/aaa/mod_authn_socache.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,13 @@ static const char *construct_key(request_rec *r, const char *context,
231231
/* handle "special" context values */
232232
if (!strcmp(context, "directory")) {
233233
/* FIXME: are we at risk of this blowing up? */
234+
char *new_context;
234235
char *slash = strrchr(r->uri, '/');
235-
context = apr_palloc(r->pool, slash - r->uri +
236-
strlen(r->server->server_hostname) + 1);
237-
strcpy(context, r->server->server_hostname);
238-
strncat(context, r->uri, slash - r->uri);
236+
new_context = apr_palloc(r->pool, slash - r->uri +
237+
strlen(r->server->server_hostname) + 1);
238+
strcpy(new_context, r->server->server_hostname);
239+
strncat(new_context, r->uri, slash - r->uri);
240+
context = new_context;
239241
}
240242
else if (!strcmp(context, "server")) {
241243
context = r->server->server_hostname;

0 commit comments

Comments
 (0)