Fixed C compiler warning about unused variable when not building in debug, continued.
authorEdouard Tisserant <edouard@pep-project.org>
Tue, 23 May 2017 11:55:30 +0200
changeset 1803656f58b5b244
parent 1802 88931f5dcf75
child 1809 54a7d37790b9
Fixed C compiler warning about unused variable when not building in debug, continued.
src/pgp_gpg.c
     1.1 --- a/src/pgp_gpg.c	Tue May 23 11:04:45 2017 +0200
     1.2 +++ b/src/pgp_gpg.c	Tue May 23 11:55:30 2017 +0200
     1.3 @@ -39,8 +39,7 @@
     1.4          assert(length == stringlist_length(values));
     1.5          if (!(length == stringlist_length(values) &&
     1.6                length <= sizeof(unsigned int) * CHAR_BIT)) {
     1.7 -            r = Fclose(f);
     1.8 -            assert(r == 0);
     1.9 +            Fclose(f);
    1.10  
    1.11              return false;
    1.12          }
    1.13 @@ -62,6 +61,8 @@
    1.14  
    1.15                          if (i == n) {
    1.16                              r = Fclose(f);
    1.17 +                            if (r != 0)
    1.18 +                                return false;
    1.19                              return true;
    1.20                          }
    1.21                      }
    1.22 @@ -83,11 +84,15 @@
    1.23          if ((found & i) == 0) {
    1.24              r = Fprintf(f, "%s %s\n", _k->value, _v->value);
    1.25              assert(r >= 0);
    1.26 +            if(r<0)
    1.27 +                return false;
    1.28          }
    1.29      }
    1.30  
    1.31      r = Fclose(f);
    1.32      assert(r == 0);
    1.33 +    if (r != 0)
    1.34 +        return false;
    1.35  
    1.36      return true;
    1.37  }
    1.38 @@ -1352,6 +1357,8 @@
    1.39  
    1.40      reading = gpg.gpgme_data_read(dh, buffer, _size);
    1.41      assert(_size == reading);
    1.42 +    if(_size != reading)
    1.43 +        return PEP_CANNOT_EXPORT_KEY;
    1.44  
    1.45      // safeguard for the naive user
    1.46      buffer[_size] = 0;