i is the state->wbuf index, not the end of the buf. It was "working"
only because the contents of buf past the null were not "space" most
of the time.
for (; i < state->lastchar && state->wbuf[i] == ' '; i++)
;
my_wcstombs (buf, buflen, state->wbuf + i, state->curpos - i);
- r = mutt_label_complete (buf, buflen, i, state->tabs);
+ r = mutt_label_complete (buf, buflen, strlen (buf), state->tabs);
replace_part (state, i, buf);
if (!r)
{