diff options
author | Sam James <sam@gentoo.org> | 2022-10-19 23:58:39 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2022-10-27 11:39:17 +0200 |
commit | 15d698d2f82dd7e42d412f7012a2dfeab28aa458 (patch) | |
tree | 80093d90dff0d3232e225c8271daaf974a66bc88 | |
parent | 49c2c81d55dab8764c7575815e7566116d4f395a (diff) |
pem: fix -Wunused-but-set-variable
The loop never uses the value of 'line'.
Fixes this error with Clang 15:
```
crypto/pem/pem_lib.c:821:14: error: variable 'line' set but not used [-Werror,-Wunused-but-set-variable]
int len, line, ret = 0, end = 0, prev_partial_line_read = 0, partial_line_read = 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 71bc497dc321adeb08e7541556dea019c81c9a87)
Signed-off-by: Sam James <sam@gentoo.org>
(Merged from https://github.com/openssl/openssl/pull/19500)
-rw-r--r-- | crypto/pem/pem_lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c index fa24831fe3..f9ff80162a 100644 --- a/crypto/pem/pem_lib.c +++ b/crypto/pem/pem_lib.c @@ -810,7 +810,7 @@ static int get_header_and_data(BIO *bp, BIO **header, BIO **data, char *name, { BIO *tmp = *header; char *linebuf, *p; - int len, line, ret = 0, end = 0, prev_partial_line_read = 0, partial_line_read = 0; + int len, ret = 0, end = 0, prev_partial_line_read = 0, partial_line_read = 0; /* 0 if not seen (yet), 1 if reading header, 2 if finished header */ enum header_status got_header = MAYBE_HEADER; unsigned int flags_mask; @@ -824,7 +824,7 @@ static int get_header_and_data(BIO *bp, BIO **header, BIO **data, char *name, return 0; } - for (line = 0; ; line++) { + while(1) { flags_mask = ~0u; len = BIO_gets(bp, linebuf, LINESIZE); if (len <= 0) { |