From: Viktor Szakats Date: Tue, 7 Oct 2025 10:04:03 +0000 (+0200) Subject: examples/usercertinmem: avoid stripping const X-Git-Tag: rc-8_17_0-2~198 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4a6bdd5899005c25ce222dc21dcfd1a779544330;p=thirdparty%2Fcurl.git examples/usercertinmem: avoid stripping const This API started accepting a const somewhere between OpenSSL 1.0.2b and 1.0.2t. It means this example, like the other similar one now works best with those versions or newer: ``` docs/examples/usercertinmem.c:100:33: error: cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual] 100 | bio = BIO_new_mem_buf((char *)mypem, -1); | ^ docs/examples/usercertinmem.c:121:34: error: cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual] 121 | kbio = BIO_new_mem_buf((char *)mykey, -1); | ^ ``` Closes #18908 --- diff --git a/docs/examples/usercertinmem.c b/docs/examples/usercertinmem.c index 670ae4dc71..50537ae25f 100644 --- a/docs/examples/usercertinmem.c +++ b/docs/examples/usercertinmem.c @@ -97,7 +97,7 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *pointer) (void)pointer; /* get a BIO */ - bio = BIO_new_mem_buf((char *)mypem, -1); + bio = BIO_new_mem_buf(mypem, -1); if(!bio) { printf("BIO_new_mem_buf failed\n"); @@ -118,7 +118,7 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *pointer) } /* create a bio for the RSA key */ - kbio = BIO_new_mem_buf((char *)mykey, -1); + kbio = BIO_new_mem_buf(mykey, -1); if(!kbio) { printf("BIO_new_mem_buf failed\n"); }