1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-26 01:15:37 +00: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 0e17711e77
commit 5371f1874a

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;
}