X-Git-Url: https://git.llucax.com/software/mutt-debian.git/blobdiff_plain/14c29200cb58d3c4a0830265f2433849781858d0..806c0bb4cb964a5f36f54b93a5d862e84b995797:/compose.c diff --git a/compose.c b/compose.c index 0957bba..5db4c92 100644 --- a/compose.c +++ b/compose.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1996-2000 Michael R. Elkins + * Copyright (C) 1996-2000,2002,2007 Michael R. Elkins * Copyright (C) 2004 g10 Code GmbH * * This program is free software; you can redistribute it and/or modify @@ -94,7 +94,7 @@ static struct mapping_t ComposeHelp[] = { { N_("Attach file"), OP_COMPOSE_ATTACH_FILE }, { N_("Descrip"), OP_COMPOSE_EDIT_DESCRIPTION }, { N_("Help"), OP_HELP }, - { NULL } + { NULL, 0 } }; static void snd_entry (char *b, size_t blen, MUTTMENU *menu, int num) @@ -217,7 +217,7 @@ check_attachments(ATTACHPTR **idx, short idxlen) strfcpy(pretty, idx[i]->content->filename, sizeof(pretty)); if(stat(idx[i]->content->filename, &st) != 0) { - mutt_pretty_mailbox(pretty); + mutt_pretty_mailbox(pretty, sizeof (pretty)); mutt_error(_("%s [#%d] no longer exists!"), pretty, i+1); return -1; @@ -225,7 +225,7 @@ check_attachments(ATTACHPTR **idx, short idxlen) if(idx[i]->content->stamp < st.st_mtime) { - mutt_pretty_mailbox(pretty); + mutt_pretty_mailbox(pretty, sizeof (pretty)); snprintf(msg, sizeof(msg), _("%s [#%d] modified. Update encoding?"), pretty, i+1); @@ -511,8 +511,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ mutt_attach_init (msg->content); idx = mutt_gen_attach_list (msg->content, -1, idx, &idxlen, &idxmax, 0, 1); - menu = mutt_new_menu (); - menu->menu = MENU_COMPOSE; + menu = mutt_new_menu (MENU_COMPOSE); menu->offset = HDR_ATTACH; menu->max = idxlen; menu->make_entry = snd_entry; @@ -568,8 +567,8 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ strfcpy (buf, fcc, sizeof (buf)); if (mutt_get_field ("Fcc: ", buf, sizeof (buf), M_FILE | M_CLEAR) == 0) { - strfcpy (fcc, buf, _POSIX_PATH_MAX); - mutt_pretty_mailbox (fcc); + strfcpy (fcc, buf, fcclen); + mutt_pretty_mailbox (fcc, fcclen); move (HDR_FCC, HDR_XOFFSET); mutt_paddstr (W, fcc); fccSet = 1; @@ -717,7 +716,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ if (Context) { strfcpy (fname, NONULL (Context->path), sizeof (fname)); - mutt_pretty_mailbox (fname); + mutt_pretty_mailbox (fname, sizeof (fname)); } if (mutt_enter_fname (prompt, fname, sizeof (fname), &menu->redraw, 1) == -1 || !fname[0]) @@ -1005,7 +1004,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ case OP_COMPOSE_RENAME_FILE: CHECK_COUNT; strfcpy (fname, idx[menu->current]->content->filename, sizeof (fname)); - mutt_pretty_mailbox (fname); + mutt_pretty_mailbox (fname, sizeof (fname)); if (mutt_get_field (_("Rename to: "), fname, sizeof (fname), M_FILE) == 0 && fname[0]) { @@ -1074,7 +1073,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ FREE (&idx[idxlen]); continue; } - fclose (fp); + safe_fclose (&fp); if ((idx[idxlen]->content = mutt_make_file_attach (fname)) == NULL) { @@ -1194,7 +1193,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ if (Context) { strfcpy (fname, NONULL (Context->path), sizeof (fname)); - mutt_pretty_mailbox (fname); + mutt_pretty_mailbox (fname, sizeof (fname)); } if (idxlen) msg->content = idx[0]->content;