X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=edit.c;h=1674248137caa2ca22a36eb77737330be10a3630;hp=e29cb6691efaa61ef4e6bc1b5c25900361bcc03a;hb=777c7ccc259a8b7f5fadac70267c59e62a2cb300;hpb=6833ce8bdca2d64e14485118f2a4417b7e1cb1b1 diff --git a/edit.c b/edit.c index e29cb66..1674248 100644 --- a/edit.c +++ b/edit.c @@ -18,6 +18,10 @@ /* Close approximation of the mailx(1) builtin editor for sending mail. */ +#if HAVE_CONFIG_H +# include "config.h" +#endif + #include "mutt.h" #include "mutt_curses.h" #include "mutt_idna.h" @@ -118,7 +122,7 @@ static int be_barf_file (const char *path, char **buf, int buflen) FILE *f; int i; - if ((f = fopen (path, "w")) == NULL) /* __FOPEN_CHECKED__ */ + if ((f = safe_fopen (path, "w")) == NULL) /* __FOPEN_CHECKED__ */ { addstr (strerror (errno)); addch ('\n'); @@ -463,7 +467,7 @@ int mutt_builtin_editor (const char *path, HEADER *msg, HEADER *cur) done = 1; else { - strncat (tmp, "\n", sizeof(tmp)); tmp[sizeof(tmp) - 1] = '\0'; + safe_strcat (tmp, sizeof (tmp), "\n"); if (buflen == bufmax) safe_realloc (&buf, sizeof (char *) * (bufmax += 25)); buf[buflen++] = safe_strdup (tmp[1] == '~' ? tmp + 1 : tmp);