grid.c: prevent overflow of div_list
This commit is contained in:
parent
e096101133
commit
986f9b7535
|
|
@ -389,6 +389,9 @@ lingrid(GRAPH *graph, double lo, double hi, double delta, int type, Axis axis)
|
|||
if (dst > div_list[i].div_lim)
|
||||
break;
|
||||
|
||||
if ((size_t) i == NUMELEMS(div_list))
|
||||
i--;
|
||||
|
||||
do {
|
||||
step = div_list[i].step;
|
||||
nsp = (int)((dst + step - 0.0001) / step);
|
||||
|
|
|
|||
Loading…
Reference in New Issue