X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=state.c;h=12edf412a97ed229c6197e0687f16db2a7e805bf;hp=2f0c8f7bfd1c10b3eb0c810a6a6950e6f16b5d6e;hb=07066d3ea19865d08c4a8fd98b5e87eeace810da;hpb=2293e9bc5a94ef33dc596b064c607d6bed5ad1fd diff --git a/state.c b/state.c index 2f0c8f7..12edf41 100644 --- a/state.c +++ b/state.c @@ -6,13 +6,8 @@ * It's licensed under the GNU General Public License, * please see the file GPL in the top level source directory. */ -#if HAVE_CONFIG_H -#include "config.h" -#endif -#include -#include -#include +#include #include @@ -38,7 +33,7 @@ void mutt_convert_to_state (iconv_t cd, char *bufi, ssize_t * l, STATE * s) if (!bufi) { if (cd != MUTT_ICONV_ERROR) { ob = bufo, obl = sizeof (bufo); - my_iconv(cd, 0, 0, &ob, &obl); + mutt_iconv(cd, 0, 0, &ob, &obl); if (ob != bufo) state_prefix_put (bufo, ob - bufo, s); } @@ -56,7 +51,7 @@ void mutt_convert_to_state (iconv_t cd, char *bufi, ssize_t * l, STATE * s) ib = bufi, ibl = *l; for (;;) { ob = bufo, obl = sizeof (bufo); - mutt_iconv (cd, &ib, &ibl, &ob, &obl, 0, "?"); + mutt_iconv (cd, &ib, &ibl, &ob, &obl); if (ob == bufo) break; state_prefix_put (bufo, ob - bufo, s); @@ -74,7 +69,7 @@ void state_prefix_putc (char c, STATE * s) Quotebuf[i++] = c; Quotebuf[i] = '\0'; if (i == sizeof (Quotebuf) - 1 || c == '\n') { - char buf[2 * SHORT_STRING]; + char buf[2 * STRING]; int j = 0, offset = 0; regmatch_t pmatch[1]; @@ -92,8 +87,8 @@ void state_prefix_putc (char c, STATE * s) for (i = 0; i < offset; i++) if (Quotebuf[i] != ' ') j = i; - strncpy (buf, Quotebuf, j + 1); - strcpy (buf + j + 1, Quotebuf + j); + m_strncpy(buf, sizeof(buf), Quotebuf, j + 1); + m_strcpy(buf + j + 1, sizeof(buf) - j - 1, Quotebuf + j); } else snprintf (buf, sizeof (buf), "%s%s", NONULL (s->prefix), Quotebuf); @@ -124,7 +119,7 @@ int state_printf (STATE * s, const char *fmt, ...) void state_mark_attach (STATE * s) { - if ((s->flags & M_DISPLAY) && !m_strcmp(Pager, "builtin")) + if (s->flags & M_DISPLAY) state_puts (AttachmentMarker, s); }