From 8a95461ae3f0bbe529129d018dfbdd6bde3220a8 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 3 Mar 2019 17:14:20 +0100 Subject: [PATCH] PVS: V530 The return value of function 'freopen' is required to be utilized --- src/Main/MainGui.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Main/MainGui.cpp b/src/Main/MainGui.cpp index 9a332c1a90..3b20a990cd 100644 --- a/src/Main/MainGui.cpp +++ b/src/Main/MainGui.cpp @@ -78,10 +78,13 @@ public: : fi(Base::FileInfo::getTempFileName()), file(f) { #ifdef WIN32 - _wfreopen(fi.toStdWString().c_str(),L"w",file); + FILE* ptr = _wfreopen(fi.toStdWString().c_str(),L"w",file); #else - freopen(fi.filePath().c_str(),"w",file); + FILE* ptr = freopen(fi.filePath().c_str(),"w",file); #endif + if (!ptr) { + std::cerr << "Failed to reopen file" << std::endl; + } } ~Redirection() {