Pass correct length to mbstowcs
Too used to sizeof being the right thing for regular strings.
This commit is contained in:
parent
2816c019a3
commit
77a7c02435
2
edit.c
2
edit.c
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user