aboutsummaryrefslogtreecommitdiffstats
path: root/g10/plaintext.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/plaintext.c')
-rw-r--r--g10/plaintext.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/g10/plaintext.c b/g10/plaintext.c
index 3e169d93f..f20057cbb 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -545,11 +545,16 @@ do_hash (gcry_md_hd_t md, gcry_md_hd_t md2, IOBUF fp, int textmode)
}
else
{
- while ((c = iobuf_get (fp)) != -1)
+ byte *buffer = xmalloc (32768);
+ int ret;
+
+ while ((ret = iobuf_read (fp, buffer, 32768)) != -1)
{
if (md)
- gcry_md_putc (md, c);
+ gcry_md_write (md, buffer, ret);
}
+
+ xfree (buffer);
}
}