From 87f9d7da00857c649784a7d9eca046bf6e71ae3c Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Mon, 21 Jan 2013 21:19:02 +0100 Subject: [PATCH] Fix Variable 'nMode' is reassigned See http://nabble.documentfoundation.org/Cppcheck-Variable-nMode-is-reassigned-in-fstat-cxx-td4030405.html Thank you Stephan! Change-Id: I780d422fe03c4c125cc89fee778d820a20553c1c --- tools/source/fsys/fstat.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/source/fsys/fstat.cxx b/tools/source/fsys/fstat.cxx index 19f51a7e0b3a..bf1c6b788f41 100644 --- a/tools/source/fsys/fstat.cxx +++ b/tools/source/fsys/fstat.cxx @@ -108,9 +108,7 @@ sal_uIntPtr FileStat::SetReadOnlyFlag( const DirEntry &rEntry, sal_Bool bRO ) mode_t nMode; if (bRO) { - nMode = aBuf.st_mode & ~S_IWUSR; - nMode = aBuf.st_mode & ~S_IWGRP; - nMode = aBuf.st_mode & ~S_IWOTH; + nMode = aBuf.st_mode & ~(S_IWUSR | S_IWGRP | S_IWOTH); } else nMode = aBuf.st_mode | S_IWUSR;