From f69bb947dc7be4c44b8d1c86dec3a8b1214a80aa Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 9 Nov 2013 01:59:18 +0300 Subject: add more checks in file renaming function. --- src/utils/files.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/files.cpp b/src/utils/files.cpp index 15b667ba8..2d7994f8a 100644 --- a/src/utils/files.cpp +++ b/src/utils/files.cpp @@ -151,7 +151,8 @@ int Files::renameFile(const std::string &srcName, const std::string &dstName) delete [] buf; fclose(srcFile); fclose(dstFile); - ::remove(srcName.c_str()); + if (!::remove(srcName.c_str())) + return 0; - return 0; + return -1; } -- cgit v1.2.3-70-g09d2