aboutsummaryrefslogtreecommitdiffstats
path: root/rdoff
diff options
context:
space:
mode:
authorMartin Lindhe <martin-commit@ubique.se>2016-11-17 10:28:58 +0100
committerCyrill Gorcunov <gorcunov@gmail.com>2017-01-05 22:38:41 +0300
commita6ccf005a57de64f01ebd008b00882df1e5c8ab4 (patch)
tree6b498077f8193fb54a9ac931ca8a64077f0aeb2b /rdoff
parent8cc93f5232cb7e22fdfdc2315685cddfca9e0494 (diff)
downloadnasm-a6ccf005a57de64f01ebd008b00882df1e5c8ab4.tar.gz
nasm-a6ccf005a57de64f01ebd008b00882df1e5c8ab4.tar.xz
nasm-a6ccf005a57de64f01ebd008b00882df1e5c8ab4.zip
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.c6
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 */