diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-08-29 10:06:59 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-08-29 10:06:59 +0300 |
commit | 4aa0382895299d0d773d7e6a7ee7fa12a5ca5e5d (patch) | |
tree | 7668a78a72bbac056ecbc97e28d8f6dd483d30cb | |
parent | 99b2c31936f74efccd19e44147992dc0674f87e4 (diff) | |
download | mailutils-4aa0382895299d0d773d7e6a7ee7fa12a5ca5e5d.tar.gz mailutils-4aa0382895299d0d773d7e6a7ee7fa12a5ca5e5d.tar.bz2 |
libmu_sieve: cleanup
* libmu_sieve/actions.c (mime_create_quote): Use mu_stream_copy.
-rw-r--r-- | libmu_sieve/actions.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/libmu_sieve/actions.c b/libmu_sieve/actions.c index 1beb8f962..940b6913b 100644 --- a/libmu_sieve/actions.c +++ b/libmu_sieve/actions.c @@ -242,10 +242,8 @@ mime_create_quote (mu_mime_t mime, mu_message_t msg) mu_message_t newmsg; mu_stream_t istream, ostream; mu_header_t hdr; - size_t n; - char buffer[512]; - mu_body_t body; int rc; + mu_body_t body; mu_message_create (&newmsg, NULL); mu_message_get_header (newmsg, &hdr); @@ -254,14 +252,8 @@ mime_create_quote (mu_mime_t mime, mu_message_t msg) mu_body_get_streamref (body, &ostream); mu_message_get_streamref (msg, &istream); - rc = 0;/* FIXME: use mu_stream_copy */ - while (mu_stream_read (istream, buffer, sizeof buffer - 1, &n) == 0 - && n != 0) - { - rc = mu_stream_write (ostream, buffer, n, NULL); - if (rc) - break; - } + rc = mu_stream_copy (ostream, istream, 0); + mu_stream_destroy (&istream); mu_stream_close (ostream); mu_stream_destroy (&ostream); |