Prevent negative array index for realColumn in calcPosition()

Bug-Debian: https://github.com/tats/w3m/issues/69
This commit is contained in:
Tatsuya Kinoshita
2016-12-10 22:30:36 +09:00
parent 998b6f91d4
commit 1978455e2e

2
etc.c
View File

@@ -498,7 +498,7 @@ calcPosition(char *l, Lineprop *pr, int len, int pos, int bpos, int mode)
static char *prevl = NULL;
int i, j;
if (l == NULL || len == 0)
if (l == NULL || len == 0 || pos < 0)
return bpos;
if (l == prevl && mode == CP_AUTO) {
if (pos <= len)