aboutsummaryrefslogtreecommitdiff
path: root/docs/examples
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2008-09-06 05:29:05 +0000
committerYang Tse <yangsita@gmail.com>2008-09-06 05:29:05 +0000
commit59e378f48fed849e8e41f0bc6a10bf7a1732ae8a (patch)
tree2443ceace655d5d830c7c4d7c95869c6a0f93c5c /docs/examples
parenta622fd90b4c563a4fced20c5b88cb57537e809b0 (diff)
remove unnecessary typecasting of malloc()
Diffstat (limited to 'docs/examples')
-rw-r--r--docs/examples/curlx.c6
-rw-r--r--docs/examples/fopen.c2
-rw-r--r--docs/examples/opensslthreadlock.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/docs/examples/curlx.c b/docs/examples/curlx.c
index 521812b9a..09d27cc97 100644
--- a/docs/examples/curlx.c
+++ b/docs/examples/curlx.c
@@ -281,7 +281,7 @@ int main(int argc, char **argv) {
struct curl_slist * headers=NULL;
int badarg=0;
- binaryptr=(char*)malloc(tabLength);
+ binaryptr = malloc(tabLength);
p.verbose = 0;
p.errorbio = BIO_new_fp (stderr, BIO_NOCLOSE);
@@ -404,7 +404,7 @@ int main(int argc, char **argv) {
/* determine URL to go */
if (hostporturl) {
- serverurl=(char*) malloc(9+strlen(hostporturl));
+ serverurl = malloc(9+strlen(hostporturl));
sprintf(serverurl,"https://%s",hostporturl);
}
else if (p.accesstype != 0) { /* see whether we can find an AIA or SIA for a given access type */
@@ -442,7 +442,7 @@ int main(int argc, char **argv) {
/* pass our list of custom made headers */
- contenttype=(char*) malloc(15+strlen(mimetype));
+ contenttype = malloc(15+strlen(mimetype));
sprintf(contenttype,"Content-type: %s",mimetype);
headers = curl_slist_append(headers,contenttype);
curl_easy_setopt(p.curl, CURLOPT_HTTPHEADER, headers);
diff --git a/docs/examples/fopen.c b/docs/examples/fopen.c
index 0a9e9e30d..a8a4fe482 100644
--- a/docs/examples/fopen.c
+++ b/docs/examples/fopen.c
@@ -221,7 +221,7 @@ url_fopen(const char *url,const char *operation)
URL_FILE *file;
(void)operation;
- file = (URL_FILE *)malloc(sizeof(URL_FILE));
+ file = malloc(sizeof(URL_FILE));
if(!file)
return NULL;
diff --git a/docs/examples/opensslthreadlock.c b/docs/examples/opensslthreadlock.c
index 18a2f77fc..3ac7124b0 100644
--- a/docs/examples/opensslthreadlock.c
+++ b/docs/examples/opensslthreadlock.c
@@ -56,7 +56,7 @@ int thread_setup(void)
{
int i;
- mutex_buf = (MUTEX_TYPE *)malloc(CRYPTO_num_locks( ) * sizeof(MUTEX_TYPE));
+ mutex_buf = malloc(CRYPTO_num_locks( ) * sizeof(MUTEX_TYPE));
if (!mutex_buf)
return 0;
for (i = 0; i < CRYPTO_num_locks( ); i++)