X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=state.c;h=eb0a9c70000c583b7c41bf188ddcb2deb286b583;hp=86a75f5bbdf1f9a51178ca136b5b3c0c677f2b46;hb=c76ab67f3430e67b14b381bc1e3a23a14a4053b8;hpb=35f4e8cefa22d98782a720e4df428a1ce3be2237 diff --git a/state.c b/state.c index 86a75f5..eb0a9c7 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 @@ -36,7 +31,7 @@ void mutt_convert_to_state (iconv_t cd, char *bufi, ssize_t * l, STATE * s) ssize_t ibl, obl; if (!bufi) { - if (cd != (iconv_t) (-1)) { + if (cd != MUTT_ICONV_ERROR) { ob = bufo, obl = sizeof (bufo); my_iconv(cd, 0, 0, &ob, &obl); if (ob != bufo) @@ -47,7 +42,7 @@ void mutt_convert_to_state (iconv_t cd, char *bufi, ssize_t * l, STATE * s) return; } - if (cd == (iconv_t) (-1)) { + if (cd == MUTT_ICONV_ERROR) { state_prefix_put (bufi, *l, s); *l = 0; return; @@ -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);