Commit 7db85202 authored by valerie.krampe's avatar valerie.krampe

fixed bug for reading models from file (check of model size)

parent 67cca6e4
...@@ -104,7 +104,7 @@ void readmod_elastic(float ** rho, float ** pi, float ** u){ ...@@ -104,7 +104,7 @@ void readmod_elastic(float ** rho, float ** pi, float ** u){
} }
if(feof(fp_vs) && feof(fp_rho)){ if(feof(fp_vs) || feof(fp_rho)){
declare_error("Model file VS or RHO is to small. Check dimensions NX*NY of file."); declare_error("Model file VS or RHO is to small. Check dimensions NX*NY of file.");
} }
...@@ -141,7 +141,7 @@ void readmod_elastic(float ** rho, float ** pi, float ** u){ ...@@ -141,7 +141,7 @@ void readmod_elastic(float ** rho, float ** pi, float ** u){
fread(&vs, sizeof(float), 1, fp_vs); fread(&vs, sizeof(float), 1, fp_vs);
fread(&rho, sizeof(float), 1, fp_rho); fread(&rho, sizeof(float), 1, fp_rho);
if(!feof(fp_vs) && !feof(fp_rho)){ if(!feof(fp_vs) || !feof(fp_rho)){
declare_error("Model file VS or RHO is to big. Check dimensions NX*NY of file."); declare_error("Model file VS or RHO is to big. Check dimensions NX*NY of file.");
} }
fclose(fp_vs); fclose(fp_vs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment