summaryrefslogtreecommitdiff
path: root/src/porting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/porting.cpp')
-rw-r--r--src/porting.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/porting.cpp b/src/porting.cpp
index a1e6fd02d..592636336 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -81,8 +81,9 @@ void initializePaths()
#include <unistd.h>
char buf[BUFSIZ];
+ memset(buf, 0, BUFSIZ);
// Get path to executable
- readlink("/proc/self/exe", buf, BUFSIZ);
+ readlink("/proc/self/exe", buf, BUFSIZ-1);
pathRemoveFile(buf, '/');
@@ -144,8 +145,9 @@ void initializePaths()
#include <unistd.h>
char buf[BUFSIZ];
+ memset(buf, 0, BUFSIZ);
// Get path to executable
- readlink("/proc/self/exe", buf, BUFSIZ);
+ readlink("/proc/self/exe", buf, BUFSIZ-1);
pathRemoveFile(buf, '/');