/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugins.d/mandos-client.c

  • Committer: Teddy Hogeborn
  • Date: 2018-04-02 10:24:15 UTC
  • Revision ID: teddy@recompile.se-20180402102415-xrsu0wxhnmlaq29a
Minor code cleanup

* plugins.d/mandos-client.c (pgp_packet_decrypt): Use a "for"
  statement instead of a "while" statement to move initialization and
  stepping into the for statement, and reduce loop variable name
  length.

Show diffs side-by-side

added added

removed removed

Lines of Context:
502
502
        if(result->file_name != NULL){
503
503
          fprintf_plus(stderr, "File name: %s\n", result->file_name);
504
504
        }
505
 
        gpgme_recipient_t recipient;
506
 
        recipient = result->recipients;
507
 
        while(recipient != NULL){
 
505
 
 
506
        for(gpgme_recipient_t r = result->recipients; r != NULL;
 
507
            r = r->next){
508
508
          fprintf_plus(stderr, "Public key algorithm: %s\n",
509
 
                       gpgme_pubkey_algo_name
510
 
                       (recipient->pubkey_algo));
511
 
          fprintf_plus(stderr, "Key ID: %s\n", recipient->keyid);
 
509
                       gpgme_pubkey_algo_name(r->pubkey_algo));
 
510
          fprintf_plus(stderr, "Key ID: %s\n", r->keyid);
512
511
          fprintf_plus(stderr, "Secret key available: %s\n",
513
 
                       recipient->status == GPG_ERR_NO_SECKEY
514
 
                       ? "No" : "Yes");
515
 
          recipient = recipient->next;
 
512
                       r->status == GPG_ERR_NO_SECKEY ? "No" : "Yes");
516
513
        }
517
514
      }
518
515
    }