diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2022-02-13 14:27:34 +0100 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2022-03-02 20:12:28 +0100 |
commit | 9c313321a849ad5794fd90f6d5b84fee3674543c (patch) | |
tree | 545d920bc137400b25ebd3ae738bb86b93c54176 /g10 | |
parent | scd: Let READKEY support --format=ssh option. (diff) | |
download | gnupg2-9c313321a849ad5794fd90f6d5b84fee3674543c.tar.xz gnupg2-9c313321a849ad5794fd90f6d5b84fee3674543c.zip |
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>
Diffstat (limited to 'g10')
-rw-r--r-- | g10/dearmor.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/g10/dearmor.c b/g10/dearmor.c index d364678c7..c0bd9ecf6 100644 --- a/g10/dearmor.c +++ b/g10/dearmor.c @@ -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 ) |