0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-12-11 23:00:52 +00:00
termux-packages/packages/gnupg/g10-keylist.c.patch
Tee KOBAYASHI d46e3bc8a4 gnupg: Fix uninitialized local variable
```
[...]/src/g10/keylist.c:342:43: warning: variable 'indent' is uninitialized when used here [-Wuninitialized]
              tty_fprintf (fp, "\n%*s%s", indent, "", _("card-no: "));
                                          ^~~~~~
[...]/src/g10/keylist.c:310:13: note: initialize the variable 'indent' to silence this warning
  int indent;
            ^
             = 0
```
2023-01-21 08:28:40 +00:00

27 lines
973 B
Diff

--- ./g10/keylist.c~ 2022-11-25 16:05:09.000000000 +0100
+++ ./g10/keylist.c 2023-01-19 20:37:12.674592842 +0100
@@ -307,7 +307,7 @@
char *serialno;
int s2k_char;
char pkstrbuf[PUBKEY_STRING_SIZE];
- int indent;
+ const int indent = 0;
for (node = keyblock; node; node = node->next)
{
@@ -329,12 +329,11 @@
else
s2k_char = '#'; /* Key not found. */
- tty_fprintf (fp, "%s%c %s/%s %n",
+ tty_fprintf (fp, "%s%c %s/%s ",
node->pkt->pkttype == PKT_PUBLIC_KEY ? "sec" : "ssb",
s2k_char,
pubkey_string (pk, pkstrbuf, sizeof pkstrbuf),
- keystr_from_pk (pk),
- &indent);
+ keystr_from_pk (pk));
tty_fprintf (fp, _("created: %s"), datestr_from_pk (pk));
tty_fprintf (fp, " ");
tty_fprintf (fp, _("expires: %s"), expirestr_from_pk (pk));