X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=edit.c;h=d4bcc68330353a671d1d0182756040bddc59cf19;hp=47f44809b2344659cc8979ef6c78421abd66c009;hb=ab12fea9d01b3b9bc53081ae4ccc046243f1cb9f;hpb=ecaab35b973fbceb58b5ed174971c82762cc0199 diff --git a/edit.c b/edit.c index 47f4480..d4bcc68 100644 --- a/edit.c +++ b/edit.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "mutt.h" #include "enter.h" @@ -65,7 +66,7 @@ static char **be_snarf_data (FILE * f, char **buf, int *bufmax, int *buflen, tmp[sizeof (tmp) - 1] = 0; if (prefix) { - strfcpy (tmp, NONULL (Prefix), sizeof (tmp)); + m_strcpy(tmp, sizeof(tmp), NONULL(Prefix)); tmplen = m_strlen(tmp); p = tmp + tmplen; tmplen = sizeof (tmp) - tmplen; @@ -246,7 +247,7 @@ static void be_edit_header (ENVELOPE * e, int force) if (!e->subject || force) { addstr ("Subject: "); - strfcpy (tmp, e->subject ? e->subject : "", sizeof (tmp)); + m_strcpy(tmp, sizeof(tmp), NONULL(e->subject)); if (mutt_enter_string (tmp, sizeof (tmp), LINES - 1, 9, 0) == 0) str_replace (&e->subject, tmp); addch ('\n'); @@ -323,8 +324,7 @@ int mutt_builtin_editor (const char *path, HEADER * msg, HEADER * cur) while (p >= tmp && ISSPACE (*p)) *p-- = 0; - p = tmp + 2; - SKIPWS (p); + p = vskipspaces(tmp + 2); switch (tmp[1]) { case '?': @@ -374,7 +374,7 @@ int mutt_builtin_editor (const char *path, HEADER * msg, HEADER * cur) break; case 'r': if (*p) { - strncpy (tmp, p, sizeof (tmp)); + m_strcpy(tmp, sizeof(tmp), p); mutt_expand_path (tmp, sizeof (tmp)); buf = be_snarf_file (tmp, buf, &bufmax, &buflen, 1); } @@ -391,7 +391,7 @@ int mutt_builtin_editor (const char *path, HEADER * msg, HEADER * cur) case 'u': if (buflen) { buflen--; - strfcpy (tmp, buf[buflen], sizeof (tmp)); + m_strcpy(tmp, sizeof(tmp), buf[buflen]); tmp[m_strlen(tmp) - 1] = 0; p_delete(&buf[buflen]); buf[buflen] = NULL; @@ -436,10 +436,10 @@ int mutt_builtin_editor (const char *path, HEADER * msg, HEADER * cur) break; } } - else if (str_cmp (".", tmp) == 0) + else if (m_strcmp(".", tmp) == 0) done = 1; else { - str_cat (tmp, sizeof (tmp), "\n"); + m_strcat(tmp, sizeof(tmp), "\n"); if (buflen == bufmax) p_realloc(&buf, bufmax += 25); buf[buflen++] = m_strdup(tmp[1] == '~' ? tmp + 1 : tmp);