summaryrefslogtreecommitdiffstats
path: root/g10/encrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/encrypt.c')
-rw-r--r--g10/encrypt.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/g10/encrypt.c b/g10/encrypt.c
index d9af54ae6..bca7344f4 100644
--- a/g10/encrypt.c
+++ b/g10/encrypt.c
@@ -497,15 +497,9 @@ encrypt_simple (const char *filename, int mode, int use_seskey)
{
/* User requested not to create a literal packet, so we copy the
plain data. */
- byte copy_buffer[4096];
- int bytes_copied;
- while ((bytes_copied = iobuf_read(inp, copy_buffer, 4096)) != -1)
- if ( (rc=iobuf_write(out, copy_buffer, bytes_copied)) ) {
- log_error ("copying input to output failed: %s\n",
- gpg_strerror (rc) );
- break;
- }
- wipememory (copy_buffer, 4096); /* burn buffer */
+ rc = iobuf_copy (out, inp);
+ if (rc)
+ log_error ("copying input to output failed: %s\n", gpg_strerror (rc));
}
/* Finish the stuff. */