File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -33,18 +33,18 @@ namespace chesspp
33
33
// <.app>/Contents/Resources/res/img... should be where resources are stored.
34
34
std::string getResourcePath ()
35
35
{
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 );
39
39
std::string ret;
40
40
#if defined(__linux__)
41
- if (readlink (" /proc/self/exe" , buf, sizeof (buf) ) == -1 )
41
+ if (readlink (" /proc/self/exe" , buf, SIZE ) == -1 )
42
42
throw chesspp::exception (" Unable to determine executable path on Linux." );
43
43
ret = buf;
44
44
ret = ret.substr (0 , ret.find_last_of (' /' )+1 );
45
45
46
46
#elif defined(_WIN32)
47
- if (GetModuleFileNameA (NULL , buf, sizeof (buf) ) == 0 )
47
+ if (GetModuleFileNameA (NULL , buf, SIZE ) == 0 )
48
48
throw chesspp::exception (" Unable to determine executable path on Windows." );
49
49
ret = buf;
50
50
boost::replace_all (ret, " \\ " , " /" );
You can’t perform that action at this time.
0 commit comments