summaryrefslogtreecommitdiff
path: root/src/porting.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-02-08 01:12:55 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-02-08 01:12:55 +0200
commitdd9e82f5bc2982abab436afdd68df799c6fdd857 (patch)
tree1aae2e8c85ed3630feb0f3af758ba4aa0f4a6d6c /src/porting.cpp
parent25a7fabed83caccb2c321bb4d080c5907f37b60a (diff)
downloadminetest-dd9e82f5bc2982abab436afdd68df799c6fdd857.tar.gz
minetest-dd9e82f5bc2982abab436afdd68df799c6fdd857.tar.bz2
minetest-dd9e82f5bc2982abab436afdd68df799c6fdd857.zip
bug-fixin'
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, '/');