1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-18 06:08:16 +00:00

Add some missing returncode checks to get_exec_path()

This commit is contained in:
jsteube 2016-11-20 14:01:13 +01:00
parent 7f1dbf5a33
commit aa1b7408a0

View File

@ -32,10 +32,14 @@ static int get_exec_path (char *exec_path, const size_t exec_path_sz)
const ssize_t len = readlink (tmp, exec_path, exec_path_sz - 1); const ssize_t len = readlink (tmp, exec_path, exec_path_sz - 1);
if (len == -1) return -1;
#elif defined (_WIN) #elif defined (_WIN)
const DWORD len = GetModuleFileName (NULL, exec_path, exec_path_sz - 1); const DWORD len = GetModuleFileName (NULL, exec_path, exec_path_sz - 1);
if (len == 0) return -1;
#elif defined (__APPLE__) #elif defined (__APPLE__)
u32 size = (u32) exec_path_sz; u32 size = (u32) exec_path_sz;
@ -61,6 +65,8 @@ static int get_exec_path (char *exec_path, const size_t exec_path_sz)
const ssize_t len = readlink (tmp, exec_path, exec_path_sz - 1); const ssize_t len = readlink (tmp, exec_path, exec_path_sz - 1);
if (len == -1) return -1;
#else #else
#error Your Operating System is not supported or detected #error Your Operating System is not supported or detected
#endif #endif