#2106: Make ParseFile.c more robust -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: reopened Priority: unset | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by rhaas):
Not sure how good that actually is
1. {{{*filesize}}} does not need to be set to anything in case of failures since we call {{{CCTK_Error}}} anyway. Not that it is a bad idea to set to an "invalid" value in that case, though maybe "-1" and making {{{filesize}}} a {{{long int *}}} would be better since the file could actually be empty. 2. this it still seems to compare the result of ftell to {{{<0}}} instead of the documented value of {{{-1}}}. While I strongly doubt that in this particular way of coding this comparison, there will be a problem (since it would require that the standard uses another negative value, other than -1, to indicate a non-error return of ftell) I do not quite see why we would deliberately test for a condition that is (at least in principle even if not in practise) different from the one documented.