]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
txt_db: fix -Wunused-but-set-variable
authorSam James <sam@gentoo.org>
Wed, 19 Oct 2022 23:10:27 +0000 (00:10 +0100)
committerTomas Mraz <tomas@openssl.org>
Fri, 21 Oct 2022 13:56:32 +0000 (15:56 +0200)
The loop never uses the value of 'ln'.

Fixes this error with Clang 15:
```
crypto/txt_db/txt_db.c:24:10: error: variable 'ln' set but not used [-Werror,-Wunused-but-set-variable]
    long ln = 0;
         ^
1 error generated.
```

Signed-off-by: Sam James <sam@gentoo.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19450)

crypto/txt_db/txt_db.c

index 6744c03531f129bd59dc4a7d397646587949a54a..4410e35ee1d997eb90c519ded1a7db9241a768aa 100644 (file)
@@ -21,7 +21,6 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
 {
     TXT_DB *ret = NULL;
     int esc = 0;
-    long ln = 0;
     int i, add, n;
     int size = BUFSIZE;
     int offset = 0;
@@ -61,7 +60,6 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
         }
         buf->data[offset] = '\0';
         BIO_gets(in, &(buf->data[offset]), size - offset);
-        ln++;
         if (buf->data[offset] == '\0')
             break;
         if ((offset == 0) && (buf->data[0] == '#'))