diff src/netbeans.c @ 2770:25672ad7f377 v7.3.161

updated for version 7.3.161 Problem: Items on the stack may be too big. Solution: Make items static or allocate them.
author Bram Moolenaar <bram@vim.org>
date Mon, 11 Apr 2011 21:35:11 +0200
parents c5e47b752f07
children af76a61a7f79
line wrap: on
line diff
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -2891,7 +2891,7 @@ netbeans_beval_cb(
     char_u	*text;
     linenr_T	lnum;
     int		col;
-    char	buf[MAXPATHL * 2 + 25];
+    char	*buf;
     char_u	*p;
 
     /* Don't do anything when 'ballooneval' is off, messages scrolled the
@@ -2905,15 +2905,20 @@ netbeans_beval_cb(
 	 * length. */
 	if (text != NULL && text[0] != NUL && STRLEN(text) < MAXPATHL)
 	{
-	    p = nb_quote(text);
-	    if (p != NULL)
+	    buf = (char *)alloc(MAXPATHL * 2 + 25);
+	    if (buf != NULL)
 	    {
-		vim_snprintf(buf, sizeof(buf),
-				       "0:balloonText=%d \"%s\"\n", r_cmdno, p);
-		vim_free(p);
+		p = nb_quote(text);
+		if (p != NULL)
+		{
+		    vim_snprintf(buf, MAXPATHL * 2 + 25,
+				     "0:balloonText=%d \"%s\"\n", r_cmdno, p);
+		    vim_free(p);
+		}
+		nbdebug(("EVT: %s", buf));
+		nb_send(buf, "netbeans_beval_cb");
+		vim_free(buf);
 	    }
-	    nbdebug(("EVT: %s", buf));
-	    nb_send(buf, "netbeans_beval_cb");
 	}
 	vim_free(text);
     }