X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e709643ef0c5b61c6c878016c418bffa2b1b20cd..d954f6b7bcf8a03a4cd383ea8684ef63c7b86e5f:/src/xbt/xbt_os_file.cpp 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