diff options
author | Martin Lindhe <martin-commit@ubique.se> | 2016-11-17 10:28:58 +0100 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2017-01-05 22:38:41 +0300 |
commit | a6ccf005a57de64f01ebd008b00882df1e5c8ab4 (patch) | |
tree | 6b498077f8193fb54a9ac931ca8a64077f0aeb2b /rdoff | |
parent | 8cc93f5232cb7e22fdfdc2315685cddfca9e0494 (diff) | |
download | nasm-a6ccf005a57de64f01ebd008b00882df1e5c8ab4.tar.gz |
rdoff: check return value of freopen
fixes pvs-studio error 'V530 The return value of function 'freopen'
is required to be utilized.'
Signed-off-by: Martin Lindhe <martin-commit@ubique.se>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'rdoff')
-rw-r--r-- | rdoff/rdflib.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/rdoff/rdflib.c b/rdoff/rdflib.c index 0844e6ce..a1c3abe7 100644 --- a/rdoff/rdflib.c +++ b/rdoff/rdflib.c @@ -351,7 +351,11 @@ int main(int argc, char **argv) fseek(fp, 0, SEEK_SET); copybytes(fp, fptmp, l); rewind(fptmp); - freopen(argv[2], "wb", fp); + if (freopen(argv[2], "wb", fp) == NULL) { + fprintf(stderr, "rdflib: could not reopen '%s'\n", argv[2]); + perror("rdflib"); + exit(1); + } while (!feof(fptmp)) { /* read name */ |