diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-02-08 01:12:55 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-02-08 01:12:55 +0200 |
commit | dd9e82f5bc2982abab436afdd68df799c6fdd857 (patch) | |
tree | 1aae2e8c85ed3630feb0f3af758ba4aa0f4a6d6c /src/porting.cpp | |
parent | 25a7fabed83caccb2c321bb4d080c5907f37b60a (diff) | |
download | minetest-dd9e82f5bc2982abab436afdd68df799c6fdd857.tar.gz minetest-dd9e82f5bc2982abab436afdd68df799c6fdd857.tar.bz2 minetest-dd9e82f5bc2982abab436afdd68df799c6fdd857.zip |
bug-fixin'
Diffstat (limited to 'src/porting.cpp')
-rw-r--r-- | src/porting.cpp | 6 |
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, '/'); |