if (w > max_width || (k = wcrtomb (scratch, wc, &mbstate2)) > destlen)
if (w > max_width || (k2 = wcrtomb (scratch, wc, &mbstate2)) > destlen)
void mutt_format_string (char *dest, size_t destlen,			 int min_width, int max_width,			 int right_justify, char pad_char,			 const char *s, size_t n){  char *p;  wchar_t wc;  int w;  size_t k;  char scratch[MB_LEN_MAX];  mbstate_t mbstate1, mbstate2;  memset(&mbstate1, 0, sizeof (mbstate1));  memset(&mbstate2, 0, sizeof (mbstate2));  --destlen;  p = dest;  for (; n && (k = mbrtowc (&wc, s, n, &mbstate1)); s += k, n -= k)  {    if (k == (size_t)(-1) || k == (size_t)(-2))    {      k = 1;      wc = replacement_char ();    }    w = wc < M_TREE_MAX ? 1 : wcwidth (wc); /* hack */    if (w >= 0)    {      if (w > max_width || (k = wcrtomb (scratch, wc, &mbstate2)) > destlen)	break;      min_width -= w;      max_width -= w;      strncpy (p, scratch, k);      p += k;                  destlen -= k;    }  }  w = (int)destlen < min_width ? destlen : min_width;  if (w <= 0)    *p = '\0';  else if (right_justify)  {    p[w] = '\0';    while (--p >= dest)      p[w] = *p;    while (--w >= 0)      dest[w] = pad_char;  }  else  {    while (--w >= 0)      *p++ = pad_char;    *p = '\0';  }}