Prevent crash if nsp is evaluated to 0
This commit is contained in:
parent
20abe9ca38
commit
0557bc60bf
|
|
@ -633,6 +633,8 @@ lingrid(GRAPH *graph, double lo, double hi, double delta, int type, Axis axis)
|
|||
nsp = (int)((hi - lo) / delta);
|
||||
if (nsp > 100)
|
||||
nsp = 100;
|
||||
if (nsp < 1)
|
||||
nsp = 1;
|
||||
}
|
||||
spacing = (max - margin) / nsp;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue