grid.c: prevent overflow of div_list

This commit is contained in:
h_vogt 2012-09-26 21:12:26 +02:00
parent e096101133
commit 986f9b7535
1 changed files with 3 additions and 0 deletions

View File

@ -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);