X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8bc85164acb335cf909052b966b2ee4932e06cd7..8fb33d38a40ca0d377aa543a401d34309514e542:/src/xbt/xbt_os_file.cpp?ds=sidebyside diff --git a/src/xbt/xbt_os_file.cpp b/src/xbt/xbt_os_file.cpp index 713009edb6..229ac5ee64 100644 --- a/src/xbt/xbt_os_file.cpp +++ b/src/xbt/xbt_os_file.cpp @@ -14,20 +14,21 @@ #endif #if HAVE_UNISTD_H +#include +#include #include #endif #include -#include #include /* POSIX dirname */ simgrid::xbt::Path::Path() { #if HAVE_UNISTD_H - char buffer[2048]; - const char* ret = getcwd(buffer, 2048); - xbt_assert(ret == buffer, "Error during getcwd: %s", strerror(errno)); - path_ = std::string(buffer); + std::array buffer; + const char* cwd = getcwd(buffer.data(), 2048); + xbt_assert(cwd != nullptr, "Error during getcwd: %s", strerror(errno)); + path_ = std::string(cwd); #else path_ = std::string("."); #endif