Commit 566684ea authored by Paul Eggert's avatar Paul Eggert

* fns.c (Fload_average): Don't assume 100 * load average fits in int.

parent de41a810
2011-06-14 Paul Eggert <eggert@cs.ucla.edu>
* fns.c (Fload_average): Don't assume 100 * load average fits in int.
* fns.c: Don't overflow int when computing a list length.
* fns.c (QUIT_COUNT_HEURISTIC): New constant.
(Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
......
......@@ -2542,8 +2542,8 @@ advisable. */)
while (loads-- > 0)
{
Lisp_Object load = (NILP (use_floats) ?
make_number ((int) (100.0 * load_ave[loads]))
Lisp_Object load = (NILP (use_floats)
? make_number (100.0 * load_ave[loads])
: make_float (load_ave[loads]));
ret = Fcons (load, ret);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment