diff options
author | Werner Koch <wk@gnupg.org> | 2020-11-11 15:22:51 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2020-11-11 15:23:22 +0100 |
commit | d574213ce21c495d9432eeb5956e8857826876c6 (patch) | |
tree | e5ca4539906ac55975683f6163853f1bd6b5c2c0 /g10/keydb.c | |
parent | gpg: Fix the previous commit. (diff) | |
download | gnupg2-d574213ce21c495d9432eeb5956e8857826876c6.tar.xz gnupg2-d574213ce21c495d9432eeb5956e8857826876c6.zip |
w32: Replace some fopen by es_fopen.
* agent/protect-tool.c (read_file): Replace fopen by es_fopen.
* dirmngr/dirmngr-client.c (read_pem_certificate): Ditto.
(read_certificate): Ditto.
* g10/keydb.c (rt_from_file): Ditto.
* kbx/kbxutil.c (read_file): Ditto.
* g10/plaintext.c (get_output_file) [__riscos__]: Remove code.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/keydb.c')
-rw-r--r-- | g10/keydb.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/g10/keydb.c b/g10/keydb.c index 2db231136..3938d7e16 100644 --- a/g10/keydb.c +++ b/g10/keydb.c @@ -418,22 +418,22 @@ rt_from_file (const char *filename, int *r_found, int *r_openpgp) { u32 magic; unsigned char verbuf[4]; - FILE *fp; + estream_t fp; KeydbResourceType rt = KEYDB_RESOURCE_TYPE_NONE; *r_found = *r_openpgp = 0; - fp = fopen (filename, "rb"); + fp = es_fopen (filename, "rb"); if (fp) { *r_found = 1; - if (fread (&magic, 4, 1, fp) == 1 ) + if (es_fread (&magic, 4, 1, fp) == 1 ) { if (magic == 0x13579ace || magic == 0xce9a5713) ; /* GDBM magic - not anymore supported. */ - else if (fread (&verbuf, 4, 1, fp) == 1 + else if (es_fread (&verbuf, 4, 1, fp) == 1 && verbuf[0] == 1 - && fread (&magic, 4, 1, fp) == 1 + && es_fread (&magic, 4, 1, fp) == 1 && !memcmp (&magic, "KBXf", 4)) { if ((verbuf[3] & 0x02)) @@ -446,7 +446,7 @@ rt_from_file (const char *filename, int *r_found, int *r_openpgp) else /* Maybe empty: assume keyring. */ rt = KEYDB_RESOURCE_TYPE_KEYRING; - fclose (fp); + es_fclose (fp); } return rt; |