]> granicus.if.org Git - curl/commitdiff
mbedtls: fix variable shadow warning
authorJay Satiro <raysatiro@yahoo.com>
Mon, 29 May 2017 21:38:33 +0000 (17:38 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Mon, 29 May 2017 21:38:33 +0000 (17:38 -0400)
vtls/mbedtls.c:804:69: warning: declaration of 'entropy' shadows a global declaration [-Wshadow]
 CURLcode Curl_mbedtls_random(struct Curl_easy *data, unsigned char *entropy,
                                                                     ^~~~~~~

lib/vtls/mbedtls.c

index 30f614e80413443ba6bf14b2af5d28b7d26c1b35..e7359340d75f41ae084cbdacd652d25afd6570a1 100644 (file)
@@ -67,7 +67,7 @@
 #endif
 
 #if defined(THREADING_SUPPORT)
-static mbedtls_entropy_context entropy;
+static mbedtls_entropy_context ts_entropy;
 
 static int entropy_init_initialized = 0;
 
@@ -247,11 +247,11 @@ mbed_connect_step1(struct connectdata *conn,
   }
 
 #ifdef THREADING_SUPPORT
-  entropy_init_mutex(&entropy);
+  entropy_init_mutex(&ts_entropy);
   mbedtls_ctr_drbg_init(&connssl->ctr_drbg);
 
   ret = mbedtls_ctr_drbg_seed(&connssl->ctr_drbg, entropy_func_mutex,
-                              &entropy, NULL, 0);
+                              &ts_entropy, NULL, 0);
   if(ret) {
 #ifdef MBEDTLS_ERROR_C
     mbedtls_strerror(ret, errorbuf, sizeof(errorbuf));