From 2db2dbb847ff4aff8636eb86f16c620b5b25f471 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Tue, 31 Jan 2017 14:27:09 -0800 Subject: [PATCH] Fix the mutt_label_complete() pos parameter. 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. --- enter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enter.c b/enter.c index 9dd134e45..d8fc2a513 100644 --- a/enter.c +++ b/enter.c @@ -575,7 +575,7 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, 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) { -- 2.50.1