[cig-commits] commit: Fix a bug where we were writing off the end of an array

Mercurial hg at geodynamics.org
Wed Nov 9 15:21:00 PST 2011


changeset:   638:6eea7367d54f
tag:         tip
user:        Walter Landry <wlandry at caltech.edu>
date:        Wed Nov 09 15:20:52 2011 -0800
files:       Mesh/src/SurfaceAdaptor.cxx Mesh/src/SurfaceAdaptor.h
description:
Fix a bug where we were writing off the end of an array


diff -r 2bdf46821f35 -r 6eea7367d54f Mesh/src/SurfaceAdaptor.cxx
--- a/Mesh/src/SurfaceAdaptor.cxx	Wed Nov 09 15:20:26 2011 -0800
+++ b/Mesh/src/SurfaceAdaptor.cxx	Wed Nov 09 15:20:52 2011 -0800
@@ -295,7 +295,7 @@ void _SurfaceAdaptor_AssignFromXML_Surfa
         }
       }
       else
-        memset( info->trig.origin, 0, sizeof(double) * 2 );
+        memset( info->trig.origin, 0, sizeof(double) * 3 );
 
       info->trig.amp =
         Stg_ComponentFactory_GetDouble(cf,name,(surface+"Amplitude").c_str(),1.0);
diff -r 2bdf46821f35 -r 6eea7367d54f Mesh/src/SurfaceAdaptor.h
--- a/Mesh/src/SurfaceAdaptor.h	Wed Nov 09 15:20:26 2011 -0800
+++ b/Mesh/src/SurfaceAdaptor.h	Wed Nov 09 15:20:52 2011 -0800
@@ -48,9 +48,9 @@
 
 	typedef struct {
 				/* these vectors represent things in the x-axis and z-axis */
-              double	offs[2];
-              double  endOffs[2];
-              double	grad[2];
+              double	offs[3];
+              double  endOffs[3];
+              double	grad[3];
 	} SurfaceAdaptor_WedgeInfo;
 
 	typedef struct {
@@ -64,13 +64,13 @@
 	} SurfaceAdaptor_Topo_DataInfo;
 
 	typedef struct {
-		double	origin[2];
+		double	origin[3];
 		double	amp;
 		double	freq;
 	} SurfaceAdaptor_TrigInfo;
 
 	typedef struct {
-		double	origin[2];
+		double	origin[3];
                 double  minX, maxX;
 		double	r;
                 Bool    sign;



More information about the CIG-COMMITS mailing list