From 0dda30295e477800fed119fade530694370c0054 Mon Sep 17 00:00:00 2001 From: Mukund Sivaraman Date: Wed, 23 Sep 2009 07:47:11 +0530 Subject: Add explicit casts for c++ mode in reverse-proxy.c --- src/reverse-proxy.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/reverse-proxy.c b/src/reverse-proxy.c index 6afaab2..07bc8cd 100644 --- a/src/reverse-proxy.c +++ b/src/reverse-proxy.c @@ -53,7 +53,9 @@ void reversepath_add (const char *path, const char *url) return; } - if (!(reverse = safemalloc (sizeof (struct reversepath)))) { + reverse = (struct reversepath *) safemalloc (sizeof + (struct reversepath)); + if (!reverse) { log_message (LOG_ERR, "Unable to allocate memory in reversepath_add()"); return; @@ -107,7 +109,7 @@ char *reverse_rewrite_url (struct conn_s *connptr, hashmap_t hashofheaders, /* First try locating the reverse mapping by request url */ reverse = reversepath_get (url); if (reverse) { - rewrite_url = + rewrite_url = (char *) safemalloc (strlen (url) + strlen (reverse->url) + 1); strcpy (rewrite_url, reverse->url); @@ -124,9 +126,10 @@ char *reverse_rewrite_url (struct conn_s *connptr, hashmap_t hashofheaders, strlen (REVERSE_COOKIE) + 1))) { - rewrite_url = safemalloc (strlen (url) + - strlen (reverse-> - url) + 1); + rewrite_url = (char *) safemalloc + (strlen (url) + + strlen (reverse->url) + + 1); strcpy (rewrite_url, reverse->url); strcat (rewrite_url, url + 1); -- cgit v1.2.3