summaryrefslogtreecommitdiffstats
path: root/attach.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2000-01-10 10:35:48 +0000
committerThomas Roessler <roessler@does-not-exist.org>2000-01-10 10:35:48 +0000
commit544e8ba393e9c1ca55b120f209383742211007c8 (patch)
tree5157baa0f2071aa0763254491475416832cdf991 /attach.c
parentc8e19c984e900ede0f0c09353a96c62a6aa81445 (diff)
Add (and use) a function mutt_str_replace, which essentially
replaces the sequence: safe_free (&s); s = safe_strdup (t);
Diffstat (limited to 'attach.c')
-rw-r--r--attach.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/attach.c b/attach.c
index 93658e44..57c3bde9 100644
--- a/attach.c
+++ b/attach.c
@@ -65,8 +65,7 @@ int mutt_get_tmp_attachment (BODY *a)
if((fpin = fopen(a->filename, "r")) && (fpout = safe_fopen(tempfile, "w")))
{
mutt_copy_stream (fpin, fpout);
- FREE(&a->filename);
- a->filename = safe_strdup(tempfile);
+ mutt_str_replace (&a->filename, tempfile);
a->unlink = 1;
if(a->stamp >= st.st_mtime)