Avoid unlikely load-average bug

* src/fns.c (Fload_average): Do not crash or return nonsense
if the load average exceeds most-positive-fixnum/100 (Bug#39577).
This commit is contained in:
Paul Eggert 2020-02-17 12:44:10 -08:00
parent 556cc727e5
commit 121f9bb14a

View file

@ -2843,7 +2843,7 @@ advisable. */)
while (loads-- > 0)
{
Lisp_Object load = (NILP (use_floats)
? make_fixnum (100.0 * load_ave[loads])
? double_to_integer (100.0 * load_ave[loads])
: make_float (load_ave[loads]));
ret = Fcons (load, ret);
}