art & beauty
authorvb
Thu, 26 Feb 2015 16:17:19 +0100
changeset 792363a3f35fd2
parent 78 c50876ee5dcd
child 80 b12ce95403a1
art & beauty
src/pgp_gpg.c
     1.1 --- a/src/pgp_gpg.c	Thu Feb 26 16:13:23 2015 +0100
     1.2 +++ b/src/pgp_gpg.c	Thu Feb 26 16:17:19 2015 +0100
     1.3 @@ -13,12 +13,11 @@
     1.4  static bool ensure_config_values(stringlist_t *keys, stringlist_t *values)
     1.5  {
     1.6      static char buf[MAX_LINELENGTH];
     1.7 -    int n;
     1.8 -    unsigned int i;
     1.9      int r;
    1.10      FILE *f;
    1.11      stringlist_t *_k;
    1.12      stringlist_t *_v;
    1.13 +    unsigned int i;
    1.14      unsigned int found = 0;
    1.15  
    1.16      f = Fopen(gpg_conf(), "r");
    1.17 @@ -28,12 +27,11 @@
    1.18  
    1.19      if (f != NULL) {
    1.20          int length = stringlist_length(keys);
    1.21 +        unsigned int n = (1 << length) - 1;
    1.22  
    1.23          assert(length <= sizeof(unsigned int) * CHAR_BIT);
    1.24          assert(length == stringlist_length(values));
    1.25  
    1.26 -        unsigned int n = (1 << length) - 1;
    1.27 -
    1.28          do {
    1.29              char * s;
    1.30  
    1.31 @@ -71,8 +69,8 @@
    1.32      for (i = 1, _k = keys, _v = values; _k != NULL; _k = _k->next,
    1.33              _v = _v->next, i <<= 1) {
    1.34          if ((found & i) == 0) {
    1.35 -            n = Fprintf(f, "%s %s\n", _k->value, _v->value);
    1.36 -            assert(n >= 0);
    1.37 +            r = Fprintf(f, "%s %s\n", _k->value, _v->value);
    1.38 +            assert(r >= 0);
    1.39          }
    1.40      }
    1.41  
    1.42 @@ -91,6 +89,7 @@
    1.43      if (in_first) {
    1.44          stringlist_t *conf_keys   = new_stringlist("keyserver");
    1.45          stringlist_t *conf_values = new_stringlist("hkp://keys.gnupg.net");
    1.46 +
    1.47          stringlist_add(conf_keys, "cert-digest-algo");
    1.48          stringlist_add(conf_values, "SHA256");
    1.49