This commit is contained in:
Nikita Taranov 2024-12-11 22:55:43 +01:00
parent 0b3f7d18ef
commit 5eae4e2294

View File

@ -345,10 +345,10 @@ int decompressFiles(int input_fd, char * path, char * name, bool & have_compress
int read_exe_path(char *exe, size_t buf_sz) int read_exe_path(char *exe, size_t buf_sz)
{ {
uint32_t size = static_cast<uint32_t>(buf_sz); uint32_t size = static_cast<uint32_t>(buf_sz);
char apple[size]; std::vector<char> apple(size);
if (_NSGetExecutablePath(apple, &size) != 0) if (_NSGetExecutablePath(apple.data(), &size) != 0)
return 1; return 1;
if (realpath(apple, exe) == nullptr) if (realpath(apple.data(), exe) == nullptr)
return 1; return 1;
return 0; return 0;
} }