mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
g10/dearmor: use iobuf_copy
* g10/dearmor.c (dearmor_file, enarmor_file): Use 'iobuf_copy'. -- GnuPG-bug-id: T5852 Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
This commit is contained in:
parent
8e650dbd48
commit
9c313321a8
@ -42,7 +42,6 @@ dearmor_file( const char *fname )
|
||||
armor_filter_context_t *afx;
|
||||
IOBUF inp = NULL, out = NULL;
|
||||
int rc = 0;
|
||||
int c;
|
||||
|
||||
afx = new_armor_context ();
|
||||
afx->dearmor_mode = 1;
|
||||
@ -67,8 +66,7 @@ dearmor_file( const char *fname )
|
||||
if( (rc = open_outfile (-1, fname, 0, 0, &out)) )
|
||||
goto leave;
|
||||
|
||||
while( (c = iobuf_get(inp)) != -1 )
|
||||
iobuf_put( out, c );
|
||||
iobuf_copy (out, inp);
|
||||
|
||||
leave:
|
||||
if( rc )
|
||||
@ -90,7 +88,6 @@ enarmor_file( const char *fname )
|
||||
armor_filter_context_t *afx;
|
||||
IOBUF inp = NULL, out = NULL;
|
||||
int rc = 0;
|
||||
int c;
|
||||
|
||||
afx = new_armor_context ();
|
||||
|
||||
@ -117,9 +114,7 @@ enarmor_file( const char *fname )
|
||||
afx->hdrlines = "Comment: Use \"gpg --dearmor\" for unpacking\n";
|
||||
push_armor_filter ( afx, out );
|
||||
|
||||
while( (c = iobuf_get(inp)) != -1 )
|
||||
iobuf_put( out, c );
|
||||
|
||||
iobuf_copy (out, inp);
|
||||
|
||||
leave:
|
||||
if( rc )
|
||||
|
Loading…
x
Reference in New Issue
Block a user