From dd9e82f5bc2982abab436afdd68df799c6fdd857 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 8 Feb 2011 01:12:55 +0200 Subject: bug-fixin' --- src/porting.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/porting.cpp') 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 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 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, '/'); -- cgit v1.2.3