diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2000-01-10 10:35:48 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2000-01-10 10:35:48 +0000 |
commit | 544e8ba393e9c1ca55b120f209383742211007c8 (patch) | |
tree | 5157baa0f2071aa0763254491475416832cdf991 /sendlib.c | |
parent | c8e19c984e900ede0f0c09353a96c62a6aa81445 (diff) |
Add (and use) a function mutt_str_replace, which essentially
replaces the sequence:
safe_free (&s);
s = safe_strdup (t);
Diffstat (limited to 'sendlib.c')
-rw-r--r-- | sendlib.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1381,8 +1381,7 @@ static void encode_headers (LIST *h) snprintf (tmp, sizeof (tmp), "%s: ", h->data); len = mutt_strlen (tmp); rfc2047_encode_string (tmp + len, sizeof (tmp) - len, (unsigned char *) p); - safe_free ((void **) &h->data); - h->data = safe_strdup (tmp); + mutt_str_replace (&h->data, tmp); } } } @@ -1811,8 +1810,7 @@ void mutt_prepare_envelope (ENVELOPE *env) { rfc2047_encode_string (buffer, sizeof (buffer) - 1, (unsigned char *) env->subject); - safe_free ((void **) &env->subject); - env->subject = safe_strdup (buffer); + mutt_str_replace (&env->subject, buffer); } encode_headers (env->userhdrs); |