[vlc-commits] os2: use the S_ISDIR() instead of check the bit(s) directly

Steve Lhomme git at videolan.org
Mon Jul 15 13:54:13 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jul 12 14:43:40 2019 +0200| [cf6690541c99c186ab38ad925cf17592dd5c7988] | committer: Steve Lhomme

os2: use the S_ISDIR() instead of check the bit(s) directly

It may collide with other values using the same bit.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cf6690541c99c186ab38ad925cf17592dd5c7988
---

 modules/gui/skins2/os2/os2_factory.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/skins2/os2/os2_factory.cpp b/modules/gui/skins2/os2/os2_factory.cpp
index 4d4a26cae3..479e6f60d5 100644
--- a/modules/gui/skins2/os2/os2_factory.cpp
+++ b/modules/gui/skins2/os2/os2_factory.cpp
@@ -446,7 +446,7 @@ void OS2Factory::rmDir( const std::string &rPath )
 
         filename = rPath + "\\" + filename;
 
-        if( !stat( filename.c_str(), &statbuf ) && statbuf.st_mode & S_IFDIR )
+        if( !stat( filename.c_str(), &statbuf ) && S_ISDIR(statbuf.st_mode) )
         {
             rmDir( filename );
         }



More information about the vlc-commits mailing list