X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=state.c;h=f21db7e62b30bd3b09181de3312a8272742a6e6f;hp=1d410171cb89187c6f9b2a8c7f8028aa04b98b0b;hb=e4704214cabdd0b6e10b27cff5e2194959559809;hpb=1ee89902de184a640c171ae3285bff6882a791bd diff --git a/state.c b/state.c index 1d41017..f21db7e 100644 --- a/state.c +++ b/state.c @@ -69,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]; @@ -87,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); @@ -119,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); }