From: Fabian Keil Date: Sat, 19 Dec 2020 16:10:15 +0000 (+0100) Subject: ssl_store_cert(): Declare a variable at the beginning of the the code block X-Git-Tag: v_3_0_30~189 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=0721803ed9b8e7446e7915d4cb53f2284f0631f5 ssl_store_cert(): Declare a variable at the beginning of the the code block ... to silence: cc -c -pipe -fstack-protector-all -ggdb -Wshadow -Wconversion -I/usr/local/include/ -pthread -Wall -std=c89 openssl.c -o openssl.o openssl.c:408:12: warning: GCC does not allow variable declarations in for loop initializers before C99 [-Wgcc-compat] for (int i = 0; i < bs->length; i++) ^ --- diff --git a/openssl.c b/openssl.c index e1655d88..32f8f278 100644 --- a/openssl.c +++ b/openssl.c @@ -396,6 +396,7 @@ static int ssl_store_cert(struct client_state *csp, X509* crt) } else { + int i; if (bs->type == V_ASN1_NEG_INTEGER) { if (BIO_puts(bio, " (Negative)") < 0) @@ -405,7 +406,7 @@ static int ssl_store_cert(struct client_state *csp, X509* crt) goto exit; } } - for (int i = 0; i < bs->length; i++) + for (i = 0; i < bs->length; i++) { if (BIO_printf(bio, "%02x%c", bs->data[i], ((i + 1 == bs->length) ? '\n' : ':')) <= 0)