1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

[unicode] Fix issue with negative value of cells. Refs #126

Bug appeared in 0.13.5.
This commit is contained in:
Witold Filipczyk 2021-09-02 16:35:18 +02:00
parent c30c6fa6c2
commit 3026d8f25e

View File

@ -129,9 +129,8 @@ static const struct RangeLut RANGE_LUT_LIST[] = {
};
static const int RANGE_LUT_LIST_SIZE = 4;
int
unicode_to_cell(unicode_val_T ucs4)
static int
unicode_to_cell_konsole(unicode_val_T ucs4)
{
const struct RangeLut *rl;
@ -158,3 +157,11 @@ unicode_to_cell(unicode_val_T ucs4)
return RANGE_LUT_LIST[RANGE_LUT_LIST_SIZE - 1].width;
}
int
unicode_to_cell(unicode_val_T ucs4)
{
int res = unicode_to_cell_konsole(ucs4);
return res >= 0 ? res : 0;
}