]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid unlikely load-average bug
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 17 Feb 2020 20:44:10 +0000 (12:44 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 17 Feb 2020 20:44:29 +0000 (12:44 -0800)
* src/fns.c (Fload_average): Do not crash or return nonsense
if the load average exceeds most-positive-fixnum/100 (Bug#39577).

src/fns.c

index 436ef1c7b74313f649dd1de379e16d7be96ec155..80012fa9d28729242a46d46c84acd89fb88efd9d 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -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);
     }