[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#2977: vgrind: name clash causes coredump (fix included)



Package: vgrind
Version: 5.7-2

Vgrind's vfontedpr.c uses a variable _start, which clashes with a _start
used in the C library (probably a pointer to a code segment).
It compiles OK, but dumps core as a result of this.

Fix: rename _start
-- cut me --
diff -u -r vgrind-5.7.orig/vfontedpr.c vgrind-5.7/vfontedpr.c
--- vgrind-5.7.orig/vfontedpr.c	Mon Mar 13 22:33:08 1995
+++ vgrind-5.7/vfontedpr.c	Sun May 12 17:39:15 1996
@@ -125,7 +125,7 @@
  *  global variables also used by expmatch
  */
 boolean _escaped;		/* if last character was an escape */
-char *_start;			/* start of the current string */
+char *cur_start;		/* start of the current string */
 boolean	l_onecase;		/* upper and lower case are equivalent */

 #define	ps(x)	printf("%s", x)
@@ -363,7 +363,7 @@
     char *blksptr;			/* end of a lexical block start */
     char *blkeptr;			/* end of a lexical block end */

-    _start = os;			/* remember the start for expmatch */
+    cur_start = os;			/* remember the start for expmatch */
     _escaped = FALSE;
     if (nokeyw || incomm || instr)
 	goto skip;
@@ -556,14 +556,14 @@
 	if (*start == '\t') {
 	    while (*start == '\t')
 		start++;
-	    i = tabs(_start, start) - margin / 8;
+	    i = tabs(cur_start, start) - margin / 8;
 	    printf("\\h'|%dn'", i * 10 + 1 - margin % 8);
 	    continue;
 	}

 	if (!nokeyw && !force)
 	    if ((*start == '#' || isidchr(*start))
-	    && (start == _start || !isidchr(start[-1]))) {
+	    && (start == cur_start || !isidchr(start[-1]))) {
 		i = iskw(start);
 		if (i > 0) {
 		    ps("\\*(+K");
-- Ouch! --

Greetings,
Ray


Reply to: