From ec61e1f9e5fb03df5130ec0be6677b5dfe0ea1d3 Mon Sep 17 00:00:00 2001 From: Julian Daube Date: Sun, 8 Oct 2017 03:54:31 +0200 Subject: [PATCH] try to fix cwd --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index d5e908f..b54351a 100644 --- a/main.cpp +++ b/main.cpp @@ -257,12 +257,12 @@ inline bool PathRelative(std::string path) { #include std::string cwd() { - ssize_t size = 100, nsize; + ssize_t size = 1000, nsize; while(1) { char buffer[size]; if ((nsize = readlink("/proc/self/cwd", buffer, size)) < size) { - buffer[size+1] = 0; + buffer[size] = 0; return std::string(buffer); } size = nsize + 100;