[cig-commits] commit: Fix some error checking

Mercurial hg at geodynamics.org
Thu Oct 21 16:48:55 PDT 2010


changeset:   771:8339d83da82d
tag:         tip
user:        Walter Landry <wlandry at caltech.edu>
date:        Thu Oct 21 16:45:32 2010 -0700
files:       plugins/StandardConditionFunctions/StandardConditionFunctions.c
description:
Fix some error checking


diff -r fff695e32197 -r 8339d83da82d plugins/StandardConditionFunctions/StandardConditionFunctions.c
--- a/plugins/StandardConditionFunctions/StandardConditionFunctions.c	Thu Oct 21 01:01:38 2010 -0700
+++ b/plugins/StandardConditionFunctions/StandardConditionFunctions.c	Thu Oct 21 16:45:32 2010 -0700
@@ -2465,26 +2465,26 @@ void StgFEM_StandardConditionFunctions_F
 
   Journal_Firewall(dim>=0 && dim<3,
                    Journal_Register( Error_Type,"StgFEM_StandardConditionFunctions_FileN"),
-                   "%s must be either 0, 1, or 2, but was set to %d",
+                   "%s must be either 0, 1, or 2, but was set to %d\n",
                    fileN_dim,dim);
   Journal_Firewall(N>0,
                    Journal_Register( Error_Type,"StgFEM_StandardConditionFunctions_FileN"),
-                   "%s must be greater than zero, but was set to %d.",
+                   "%s must be greater than zero, but was set to %d.\n",
                    fileN_N,N);
   if(data==NULL)
     {
       
       FILE *fp=fopen(filename,"r");
-      Journal_Firewall(filename!=NULL,
+      Journal_Firewall(fp!=NULL,
                        Journal_Register( Error_Type,"StgFEM_StandardConditionFunctions_FileN"),
-                       "Bad filename for %s.  Could not open %s",
+                       "Bad filename for %s.  Could not open %s\n",
                        fileN_name,filename);
       data=(double *)malloc(N*sizeof(double));
       coords=(double *)malloc(N*sizeof(double));
 
       Journal_Firewall(data!=NULL && coords!=NULL,
                        Journal_Register( Error_Type,"StgFEM_StandardConditionFunctions_FileN"),
-                       "Could not allocate enough memory for %s",file_num);
+                       "Could not allocate enough memory for %s\n",file_num);
       for(i=0;i<N;++i)
         fscanf(fp,"%lf %lf",coords+i,data+i);
     }



More information about the CIG-COMMITS mailing list