mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
[Qt] Terminate string *pszExePath after readlink and without using memset
This commit is contained in:
parent
a90e6d2bff
commit
3a4401a6b8
@ -743,9 +743,10 @@ bool SetStartOnSystemStartup(bool fAutoStart)
|
||||
else
|
||||
{
|
||||
char pszExePath[MAX_PATH+1];
|
||||
memset(pszExePath, 0, sizeof(pszExePath));
|
||||
if (readlink("/proc/self/exe", pszExePath, sizeof(pszExePath)-1) == -1)
|
||||
ssize_t r = readlink("/proc/self/exe", pszExePath, sizeof(pszExePath) - 1);
|
||||
if (r == -1)
|
||||
return false;
|
||||
pszExePath[r] = '\0';
|
||||
|
||||
fs::create_directories(GetAutostartDir());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user