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>
This commit is contained in:
Martin Lindhe 2016-11-17 10:28:58 +01:00 committed by Cyrill Gorcunov
parent 8cc93f5232
commit a6ccf005a5

View File

@ -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 */