From 0039d7107bcdfce6f3b02b46ff0495cfba07882a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Sat, 1 Apr 2017 11:10:47 +0200 Subject: kbx: Unify blob reading functions. * kbx/keybox-file.c (_keybox_read_blob): Remove. (_keybox_read_blob2): Rename to .... (_keybox_read_blob): this. Make arg options. Change all callers. * kbx/keybox-search.c (keybox_search): Factor fopen call out to ... (open_file): new. (keybox_seek): Als use open_file. Signed-off-by: Werner Koch --- kbx/keybox-dump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'kbx/keybox-dump.c') diff --git a/kbx/keybox-dump.c b/kbx/keybox-dump.c index d24f117ab..aa1d93be7 100644 --- a/kbx/keybox-dump.c +++ b/kbx/keybox-dump.c @@ -581,7 +581,7 @@ _keybox_dump_file (const char *filename, int stats_only, FILE *outfp) for (;;) { - rc = _keybox_read_blob (&blob, fp); + rc = _keybox_read_blob (&blob, fp, NULL); if (gpg_err_code (rc) == GPG_ERR_TOO_LARGE && gpg_err_source (rc) == GPG_ERR_SOURCE_KEYBOX) { @@ -704,7 +704,7 @@ _keybox_dump_find_dups (const char *filename, int print_them, FILE *outfp) } dupitems_count = 0; - while ( !(rc = _keybox_read_blob (&blob, fp)) ) + while ( !(rc = _keybox_read_blob (&blob, fp, NULL)) ) { unsigned char digest[20]; @@ -778,7 +778,7 @@ _keybox_dump_cut_records (const char *filename, unsigned long from, if (!(fp = open_file (&filename, stderr))) return gpg_error_from_syserror (); - while ( !(rc = _keybox_read_blob (&blob, fp)) ) + while ( !(rc = _keybox_read_blob (&blob, fp, NULL)) ) { if (recno > to) break; /* Ready. */ -- cgit v1.2.3