sizeof(char) is 1. By definition.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -122,7 +122,7 @@ wxString wxStandardPaths::GetExecutablePath() const
|
||||
wxString exeStr;
|
||||
|
||||
char buf[4096];
|
||||
int result = readlink("/proc/self/exe", buf, WXSIZEOF(buf) - sizeof(char));
|
||||
int result = readlink("/proc/self/exe", buf, WXSIZEOF(buf) - 1);
|
||||
if ( result != -1 )
|
||||
{
|
||||
buf[result] = '\0'; // readlink() doesn't NUL-terminate the buffer
|
||||
|
||||
Reference in New Issue
Block a user