forked from enlightenment/terminology
fix segv on word set search
This commit is contained in:
parent
d7ec90aefa
commit
cd0bfa5d0c
|
@ -2597,19 +2597,18 @@ _codepoint_is_wordsep(const Eina_Unicode g)
|
||||||
0xff65,
|
0xff65,
|
||||||
0xe002a
|
0xe002a
|
||||||
};
|
};
|
||||||
size_t imax = sizeof(wordsep)/sizeof(wordsep[0]) - 1,
|
size_t imax = (sizeof(wordsep) / sizeof(wordsep[0])) - 1,
|
||||||
imin = 0;
|
imin = 0;
|
||||||
|
|
||||||
while (imax >= imin)
|
while (imax >= imin)
|
||||||
{
|
{
|
||||||
size_t imid = (imin + imax) / 2;
|
size_t imid = (imin + imax) / 2;
|
||||||
if (wordsep[imid] == g)
|
|
||||||
return EINA_TRUE;
|
if (wordsep[imid] == g) return EINA_TRUE;
|
||||||
else if (wordsep[imid] < g)
|
else if (wordsep[imid] < g) imin = imid + 1;
|
||||||
imin = imid + 1;
|
else imax = imid - 1;
|
||||||
else
|
if ((imax == imin) || (imid == 0)) break;
|
||||||
imax = imid - 1;
|
}
|
||||||
}
|
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue