[cig-commits] r8212 - mc/3D/CitcomS/trunk/visual
tan2 at geodynamics.org
tan2 at geodynamics.org
Tue Nov 6 15:17:54 PST 2007
Author: tan2
Date: 2007-11-06 15:17:54 -0800 (Tue, 06 Nov 2007)
New Revision: 8212
Modified:
mc/3D/CitcomS/trunk/visual/project_geoid.c
Log:
Fixed a few memory errors
Modified: mc/3D/CitcomS/trunk/visual/project_geoid.c
===================================================================
--- mc/3D/CitcomS/trunk/visual/project_geoid.c 2007-11-06 23:09:55 UTC (rev 8211)
+++ mc/3D/CitcomS/trunk/visual/project_geoid.c 2007-11-06 23:17:54 UTC (rev 8212)
@@ -91,15 +91,14 @@
/* read in the geoid coefficients */
- index = 0;
- for(index=0; index<=coeff->len; index++) {
+ for(index=0; index<coeff->len; index++) {
fgets(buffer, 255, fp);
sscanf(buffer, "%d %d %f %f %f %f %f %f",
&(coeff->ll[index]), &(coeff->mm[index]),
&(coeff->clm[index]), &(coeff->slm[index]),
&fjunk0, &fjunk1, &fjunk2, &fjunk3);
/*
- fprintf(stderr, "%d %d %e %e\n",
+ fprintf(stderr, "%d %d %d %e %e\n", index,
coeff->ll[index], coeff->mm[index],
coeff->clm[index], coeff->slm[index]);
*/
@@ -256,6 +255,9 @@
}
}
+ free(cosm);
+ free(sinm);
+
return;
}
@@ -298,14 +300,14 @@
int ntheta, nphi;
/* check the input */
- if(argc == 0) {
+ if(argc == 1) {
print_help();
return 1;
}
if(argc != 5) {
fputs("Not enought input parameters provided!\n"
- "Run without arguments to see usage.\n", stderr);
+ "Run command with no argument for usage.\n", stderr);
return 1;
}
More information about the cig-commits
mailing list