-
Notifications
You must be signed in to change notification settings - Fork 69
Open
Labels
Description
void IMEManager::Update_Candidate_List(int candidate_flags)
{
...
if (list != nullptr) {
memset(list, 0, size);
bool b2 = true;
DWORD size2;
if (is_unicode) {
size2 = ImmGetCandidateListW(m_context, index, list, size);
} else {
size2 = ImmGetCandidateListA(m_context, index, list, size);
}
if (size2 == 0 || size2 > size) {
captainslog_dbgassert(size2 < size, "IME candidate buffer overrun");
b2 = false;
}
if (b2 && list->dwStyle && list->dwStyle != IME_CAND_CODE) {
if (list->dwPageStart > list->dwSelection
|| list->dwSelection >= list->dwPageSize + list->dwPageStart) {
list->dwPageStart = list->dwPageSize * (list->dwSelection / list->dwPageSize);
}
...b2 can be removed by using else if, making code simpler.