We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a90e6d2 commit 3a4401aCopy full SHA for 3a4401a
src/qt/guiutil.cpp
@@ -743,9 +743,10 @@ bool SetStartOnSystemStartup(bool fAutoStart)
743
else
744
{
745
char pszExePath[MAX_PATH+1];
746
- memset(pszExePath, 0, sizeof(pszExePath));
747
- if (readlink("/proc/self/exe", pszExePath, sizeof(pszExePath)-1) == -1)
+ ssize_t r = readlink("/proc/self/exe", pszExePath, sizeof(pszExePath) - 1);
+ if (r == -1)
748
return false;
749
+ pszExePath[r] = '\0';
750
751
fs::create_directories(GetAutostartDir());
752
0 commit comments