Pass correct length to mbstowcs

Too used to sizeof being the right thing for regular strings.
weechat-hashes
C. McEnroe 2020-04-01 12:15:44 -04:00
parent 2816c019a3
commit 77a7c02435
1 changed files with 1 additions and 1 deletions

2
edit.c
View File

@ -143,7 +143,7 @@ static void tabComplete(uint id) {
}
wchar_t wcs[Cap];
n = mbstowcs(wcs, comp, sizeof(wcs));
n = mbstowcs(wcs, comp, Cap);
assert(n != (size_t)-1);
if (tab.pos + n + 2 > Cap) {
completeReject();