changeset 37463:7db9a70334b7

(mouse_face_overlay_overlaps): Fix the computation of the number of overlays to check.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 25 Apr 2001 14:50:43 +0000
parents 60c6feb4c274
children d0e1a8c0aa8c
files src/buffer.c
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/buffer.c	Wed Apr 25 14:36:32 2001 +0000
+++ b/src/buffer.c	Wed Apr 25 14:50:43 2001 +0000
@@ -2529,15 +2529,14 @@
 {
   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);
     }