File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -33,18 +33,18 @@ namespace chesspp
3333 // <.app>/Contents/Resources/res/img... should be where resources are stored.
3434 std::string getResourcePath ()
3535 {
36- char buf[ 1024 ] ;
37- uint32_t size = sizeof ( buf) ;
38- memset (buf, 0 , sizeof (buf) );
36+ const uint32_t SIZE = 1024 ;
37+ char buf[SIZE] ;
38+ memset (buf, 0 , SIZE );
3939 std::string ret;
4040 #if defined(__linux__)
41- if (readlink (" /proc/self/exe" , buf, sizeof (buf) ) == -1 )
41+ if (readlink (" /proc/self/exe" , buf, SIZE ) == -1 )
4242 throw chesspp::exception (" Unable to determine executable path on Linux." );
4343 ret = buf;
4444 ret = ret.substr (0 , ret.find_last_of (' /' )+1 );
4545
4646 #elif defined(_WIN32)
47- if (GetModuleFileNameA (NULL , buf, sizeof (buf) ) == 0 )
47+ if (GetModuleFileNameA (NULL , buf, SIZE ) == 0 )
4848 throw chesspp::exception (" Unable to determine executable path on Windows." );
4949 ret = buf;
5050 boost::replace_all (ret, " \\ " , " /" );
You can’t perform that action at this time.
0 commit comments