Browse Source

libogsf: uninitialized variable causes unresponsive vector style settings

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@61612 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 10 năm trước cách đây
mục cha
commit
549e936225
2 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 2 0
      lib/ogsf/Gp3.c
  2. 7 0
      lib/ogsf/Gv3.c

+ 2 - 0
lib/ogsf/Gp3.c

@@ -120,6 +120,8 @@ geopoint *Gp_load_sites(const char *name, int *nsites, int *has_z)
 	    else {
 		Vect_reset_cats(Cats);
 	    }
+	    /* initialize style */
+	    gpt->highlighted = 0;
 	    
 	    G_debug(5, "loading vector point %d x=%f y=%f ncats=%d",
 		    np, Points->x[0], Points->y[0], Cats->n_cats);

+ 7 - 0
lib/ogsf/Gv3.c

@@ -97,6 +97,10 @@ geoline *Gv_load_vect(const char *grassname, int *nlines)
 	Vect_get_area_points(&map, area, points);
 	if (points->n_points < 3)
 	    continue;
+
+	/* initialize style */
+	gln->highlighted = 0;
+
 	gln->type = OGSF_POLYGON;
 	gln->npts = np = points->n_points;
 	G_debug(3, "  np = %d", np);
@@ -174,6 +178,9 @@ geoline *Gv_load_vect(const char *grassname, int *nlines)
 		/* Vect_append_point ( points, points->x[0], points->y[0], points->z[0] ); */
 	    }
 
+	    /* initialize style */
+	    gln->highlighted = 0;
+
 	    gln->npts = np = points->n_points;
 	    G_debug(3, "  np = %d", np);