diff options
| author | Simon Tatham <anakin@pobox.com> | 2014-12-16 20:34:04 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2014-12-16 20:34:04 +0000 |
| commit | cbe54149d478a58c5e385d1dd7d76fe97b1f1015 (patch) | |
| tree | e8671fb793d1efd1cb78952eff5adb2340178b7c | |
| parent | 36105490740922d350e1488c4a7534282a24b1ac (diff) | |
| download | halibut-cbe54149d478a58c5e385d1dd7d76fe97b1f1015.zip halibut-cbe54149d478a58c5e385d1dd7d76fe97b1f1015.tar.gz halibut-cbe54149d478a58c5e385d1dd7d76fe97b1f1015.tar.bz2 halibut-cbe54149d478a58c5e385d1dd7d76fe97b1f1015.tar.xz | |
Fix segfault when a source file doesn't exist.
There was a missing NULL check in the code that test-opens files in
both binary and text mode (for font-handling purposes).
| -rw-r--r-- | input.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1653,7 +1653,8 @@ paragraph *read_input(input *in, indexdata *idx) { rewind(in->currfp); } if (!binary) { - fclose(in->currfp); + if (in->currfp) + fclose(in->currfp); in->currfp = fopen(in->filenames[in->currindex], "r"); } } |