(mouse_face_overlay_overlaps): Fix the computation
authorGerd Moellmann <gerd@gnu.org>
Wed, 25 Apr 2001 14:51:11 +0000 (14:51 +0000)
committerGerd Moellmann <gerd@gnu.org>
Wed, 25 Apr 2001 14:51:11 +0000 (14:51 +0000)
of the number of overlays to check.

src/ChangeLog
src/buffer.c

index eb2f0d0..3f39931 100644 (file)
@@ -1,5 +1,8 @@
 2001-04-25  Gerd Moellmann  <gerd@gnu.org>
 
+       * buffer.c (mouse_face_overlay_overlaps): Fix the computation
+       of the number of overlays to check.
+
        * keyboard.c (command_loop_1): Redo change of 2001-03-12.
 
        * xdisp.c (try_window_id): Fix a case where window_end_pos
index a8240ba..0171f74 100644 (file)
@@ -2529,15 +2529,14 @@ mouse_face_overlay_overlaps (overlay)
 {
   int start = OVERLAY_POSITION (OVERLAY_START (overlay));
   int end = OVERLAY_POSITION (OVERLAY_END (overlay));
-  int n, i;
+  int n, i, size;
   Lisp_Object *v, tem;
   
-  n = 10;
-  v = (Lisp_Object *) alloca (n * sizeof *v);
-  i = overlays_in (start, end, 0, &v, &n, NULL, NULL);
-  if (i > n)
+  size = 10;
+  v = (Lisp_Object *) alloca (size * sizeof *v);
+  n = overlays_in (start, end, 0, &v, &size, NULL, NULL);
+  if (n > size)
     {
-      n = i;
       v = (Lisp_Object *) alloca (n * sizeof *v);
       overlays_in (start, end, 0, &v, &n, NULL, NULL);
     }