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;