aboutsummaryrefslogtreecommitdiff
path: root/src/partialator.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-10-23 15:53:19 +0200
committerThomas White <taw@physics.org>2017-10-23 16:01:37 +0200
commit45038c42847476ce1aee5b09c47fb330a0108cd6 (patch)
tree3979667c80cacc3bd34d0f59fc905a0d4c0b3d0d /src/partialator.c
parent7b6fa15e761ec0c5ae9010dc21786a1a3dda7076 (diff)
Check return values from fread/fgets
Diffstat (limited to 'src/partialator.c')
-rw-r--r--src/partialator.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/partialator.c b/src/partialator.c
index 569145e8..142ca892 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -1018,7 +1018,10 @@ int main(int argc, char *argv[])
ERROR("Failed to open '%s'\n", sparams_fn);
return 1;
}
- fgets(line, 1024, sparams_fh);
+ if ( fgets(line, 1024, sparams_fh) == NULL ) {
+ ERROR("Failed to read header from %s\n", sparams_fn);
+ return 1;
+ }
STATUS("Reading initial scaling factors (G,B) from '%s'\n",
sparams_fn);
free(sparams_fn);