]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ssl/cli: fix unused variable with openssl < 1.0.2
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 28 Jan 2020 23:04:24 +0000 (00:04 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 28 Jan 2020 23:08:10 +0000 (00:08 +0100)
src/ssl_sock.c: In function ‘cli_io_handler_show_cert’:
src/ssl_sock.c:10214:6: warning: unused variable ‘n’ [-Wunused-variable]
  int n;
      ^
Fix this problem in the io handler of the "show ssl cert" function.

src/ssl_sock.c

index 99133f0f9371429b59e0e16fd15dac4b36183331..6f92edfd6b7f09a180a5a958d86c6323202944b3 100644 (file)
@@ -10211,7 +10211,6 @@ static int cli_io_handler_show_cert(struct appctx *appctx)
        struct ebmb_node *node;
        struct stream_interface *si = appctx->owner;
        struct ckch_store *ckchs;
-       int n;
 
        if (trash == NULL)
                return 1;
@@ -10224,6 +10223,8 @@ static int cli_io_handler_show_cert(struct appctx *appctx)
                                chunk_appendf(trash, "*%s\n", ckchs->path);
 #if HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL
                        } else {
+                               int n;
+
                                chunk_appendf(trash, "*%s:", ckchs->path);
                                for (n = 0; n < SSL_SOCK_NUM_KEYTYPES; n++) {
                                        if (ckchs->ckch[n].cert)
@@ -10247,6 +10248,8 @@ static int cli_io_handler_show_cert(struct appctx *appctx)
                        chunk_appendf(trash, "%s\n", ckchs->path);
 #if HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL
                } else {
+                       int n;
+
                        chunk_appendf(trash, "%s:", ckchs->path);
                        for (n = 0; n < SSL_SOCK_NUM_KEYTYPES; n++) {
                                if (ckchs->ckch[n].cert)