[PATCH 2/3] cipher: remove unused variable idx from _gcry_pk_get_keygrip function
Rudi Heitbaum via Gnupg-devel <[email protected]> Sat, 31 Jan 2026 01:27:02 +0000
| Newsgroups | gmane.comp.encryption.gpg.devel |
|---|---|
| Message-ID | <aX1aZhj4pIw4CNXW@abf3d4a53bee> |
fixes:
../../cipher/pubkey.c: In function '_gcry_pk_get_keygrip':
../../cipher/pubkey.c:1005:7: warning: variable 'idx' set but not used [-Wunused-but-set-variable=]
1005 | int idx;
| ^~~
---
cipher/pubkey.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/cipher/pubkey.c b/cipher/pubkey.c
index 7b133498..7120c24f 100644
--- a/cipher/pubkey.c
+++ b/cipher/pubkey.c
@@ -1002,7 +1002,6 @@ _gcry_pk_get_keygrip (gcry_sexp_t key, unsigned char *array)
gcry_pk_spec_t *spec = NULL;
const char *s;
char *name = NULL;
- int idx;
const char *elems;
gcry_md_hd_t md = NULL;
int okay = 0;
@@ -1047,7 +1046,7 @@ _gcry_pk_get_keygrip (gcry_sexp_t key, unsigned char *array)
else
{
/* Generic method to compute a keygrip. */
- for (idx = 0, s = elems; *s; s++, idx++)
+ for (s = elems; *s; s++)
{
const char *data;
size_t datalen;
--
2.51.0