[Pkg-gnupg-commit] [gnupg2] 20/124: scd: Fix compiler warnings for app-openpgp.c.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Apr 5 15:55:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gnupg2.

commit e6ca015ae182a6dbb0466441efc17c99683e9375
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Mon Mar 6 15:14:18 2017 +0900

    scd: Fix compiler warnings for app-openpgp.c.
    
    * scd/app-openpgp.c (retrieve_key_material): Remove touching I.
    (do_change_pin): Make sure going to leave if PINVALUE == 0.
    (rsa_writekey): Emit simpler log.
    
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
---
 scd/app-openpgp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/scd/app-openpgp.c b/scd/app-openpgp.c
index 5e75d4b..af81dce 100644
--- a/scd/app-openpgp.c
+++ b/scd/app-openpgp.c
@@ -1280,7 +1280,6 @@ retrieve_key_material (FILE *fp, const char *hexkeyid,
 
       if ( strcmp (fields[0], "pkd") )
         continue; /* Not a key data record.  */
-      i = 0; /* Avoid erroneous compiler warning. */
       if ( nfields < 4 || (i = atoi (fields[1])) < 0 || i > 1
            || (!i && m_new) || (i && e_new))
         {
@@ -2652,7 +2651,7 @@ do_change_pin (app_t app, ctrl_t ctrl,  const char *chvnostr,
       rc = pincb (pincb_arg, set_resetcode? _("|RN|New Reset Code") :
                   chvno == 3? _("|AN|New Admin PIN") : _("|N|New PIN"),
                   &pinvalue);
-      if (rc)
+      if (rc || pinvalue == NULL)
         {
           log_error (_("error getting new PIN: %s\n"), gpg_strerror (rc));
           goto leave;
@@ -3352,8 +3351,7 @@ rsa_writekey (app_t app, gpg_error_t (*pincb)(void*, const char *, char **),
   maxbits = app->app_local->keyattr[keyno].rsa.n_bits;
   nbits = rsa_n? count_bits (rsa_n, rsa_n_len) : 0;
   if (opt.verbose)
-    log_info ("RSA modulus size is %u bits (%u bytes)\n",
-              nbits, (unsigned int)rsa_n_len);
+    log_info ("RSA modulus size is %u bits\n", nbits);
   if (nbits && nbits != maxbits
       && app->app_local->extcap.algo_attr_change)
     {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list