Fix a divide-by-zero
This commit is contained in:
committed by
Tatsuya Kinoshita
parent
9cbcd21d8d
commit
dba9fe9753
6
linein.c
6
linein.c
@@ -714,7 +714,8 @@ _rdcompl(void)
|
|||||||
static void
|
static void
|
||||||
next_dcompl(int next)
|
next_dcompl(int next)
|
||||||
{
|
{
|
||||||
static int col, row, len;
|
static int col, row;
|
||||||
|
static unsigned int len;
|
||||||
static Str d;
|
static Str d;
|
||||||
int i, j, n, y;
|
int i, j, n, y;
|
||||||
Str f;
|
Str f;
|
||||||
@@ -780,8 +781,9 @@ next_dcompl(int next)
|
|||||||
if (len < n)
|
if (len < n)
|
||||||
len = n;
|
len = n;
|
||||||
}
|
}
|
||||||
|
if (len > 0 && COLS > len)
|
||||||
col = COLS / len;
|
col = COLS / len;
|
||||||
if (col == 0)
|
else
|
||||||
col = 1;
|
col = 1;
|
||||||
row = (NCFileBuf + col - 1) / col;
|
row = (NCFileBuf + col - 1) / col;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user