@@ -119,13 +119,13 @@ neut_mesh_fscanf_msh_nodes (FILE * file, char *mode,
119119 return ;
120120}
121121
122- void
122+ int
123123neut_mesh_fscanf_msh_elts (FILE * file , char * mode , char * domain , int * node_nbs ,
124124 struct MESH * pMesh0D , struct MESH * pMesh1D ,
125125 struct MESH * pMesh2D , struct MESH * pMesh3D ,
126126 struct MESH * pMeshCo , struct MESH * * ppMesh )
127127{
128- int leftelts , dim ;
128+ int leftelts , dim , status ;
129129 struct MESH Trash ;
130130
131131 neut_mesh_set_zero (& Trash );
@@ -140,29 +140,34 @@ neut_mesh_fscanf_msh_elts (FILE * file, char *mode, char *domain, int *node_nbs,
140140 if (!strcmp (mode , "binary" ))
141141 if (fscanf (file , "%c" , & c ) != 1 )
142142 abort ();
143- leftelts -=
144- neut_mesh_fscanf_msh_elts_dim (file , mode , pMesh0D ? pMesh0D : & Trash , node_nbs , 0 ,
145- leftelts );
143+ status = neut_mesh_fscanf_msh_elts_dim (file , mode , pMesh0D ? pMesh0D : & Trash , node_nbs , 0 ,
144+ & leftelts );
145+ if (status != 0 )
146+ return status ;
146147 if (pMesh0D && (* pMesh0D ).EltQty > 0 )
147148 dim = 0 ;
148- leftelts -=
149- neut_mesh_fscanf_msh_elts_dim (file , mode , pMesh1D ? pMesh1D : & Trash , node_nbs , 1 ,
150- leftelts );
149+ status = neut_mesh_fscanf_msh_elts_dim (file , mode , pMesh1D ? pMesh1D : & Trash , node_nbs , 1 ,
150+ & leftelts );
151+ if (status != 0 )
152+ return status ;
151153 if (pMesh1D && (* pMesh1D ).EltQty > 0 )
152154 dim = 1 ;
153- leftelts -=
154- neut_mesh_fscanf_msh_elts_dim (file , mode , pMesh2D ? pMesh2D : & Trash , node_nbs , 2 ,
155- leftelts );
155+ status = neut_mesh_fscanf_msh_elts_dim (file , mode , pMesh2D ? pMesh2D : & Trash , node_nbs , 2 ,
156+ & leftelts );
157+ if (status != 0 )
158+ return status ;
156159 if (pMesh2D && (* pMesh2D ).EltQty > 0 )
157160 dim = 2 ;
158- leftelts -=
159- neut_mesh_fscanf_msh_elts_dim (file , mode , pMesh3D ? pMesh3D : & Trash , node_nbs , 3 ,
160- leftelts );
161+ status = neut_mesh_fscanf_msh_elts_dim (file , mode , pMesh3D ? pMesh3D : & Trash , node_nbs , 3 ,
162+ & leftelts );
163+ if (status != 0 )
164+ return status ;
161165 if (pMesh3D && (* pMesh3D ).EltQty > 0 )
162166 dim = 3 ;
163- leftelts -=
164- neut_mesh_fscanf_msh_elts_dim (file , mode , pMeshCo ? pMeshCo : & Trash , node_nbs , dim ,
165- leftelts );
167+ status = neut_mesh_fscanf_msh_elts_dim (file , mode , pMeshCo ? pMeshCo : & Trash , node_nbs , dim ,
168+ & leftelts );
169+ if (status != 0 )
170+ return status ;
166171
167172 ut_free_1d_int (& node_nbs );
168173
@@ -197,7 +202,7 @@ neut_mesh_fscanf_msh_elts (FILE * file, char *mode, char *domain, int *node_nbs,
197202
198203 neut_mesh_free (& Trash );
199204
200- return ;
205+ return 0 ;
201206}
202207
203208void
0 commit comments