Skip to content

Commit

Permalink
Fix length calculation after getCharFromEvent.
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsbers committed Jun 15, 2024
1 parent 9fd6e41 commit db573a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/yinputline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,9 @@ int YInputLine::getWCharFromEvent(const XKeyEvent& key, wchar_t* s, int maxLen)
int len = 0;
char buf[16];
if (getCharFromEvent(key, buf, 16)) {
len = int(strlen(buf));
YWideString w(buf, len);
memcpy(s, w.data(), w.length());
memcpy(s, w.data(), w.length() * sizeof(wchar_t));
}
return len;
}
Expand Down

0 comments on commit db573a8

Please sign in to comment.