Skip to content

Commit

Permalink
txt_db: fix -Wunused-but-set-variable
Browse files Browse the repository at this point in the history
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>

(cherry picked from commit f9e8e2c)
Signed-off-by: Sam James <sam@gentoo.org>

(Merged from #19500)
  • Loading branch information
thesamesam authored and levitte committed Oct 27, 2022
1 parent 15d698d commit e8c8f6f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions crypto/txt_db/txt_db.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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] == '#'))
Expand Down

0 comments on commit e8c8f6f

Please sign in to comment.