diff options
author | Mukund Sivaraman <muks@banu.com> | 2009-09-23 07:47:11 +0530 |
---|---|---|
committer | Mukund Sivaraman <muks@banu.com> | 2009-09-27 08:09:23 +0530 |
commit | 0dda30295e477800fed119fade530694370c0054 (patch) | |
tree | 67f8980c518235337d45023219d3fec0c584c78d /src | |
parent | 00931dfc6870e4a5e2768e39589e19539aa00047 (diff) | |
download | tinyproxy-0dda30295e477800fed119fade530694370c0054.tar.gz tinyproxy-0dda30295e477800fed119fade530694370c0054.zip |
Add explicit casts for c++ mode in reverse-proxy.c
Diffstat (limited to 'src')
-rw-r--r-- | src/reverse-proxy.c | 13 |
1 files 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); |