X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5c14275ba09456406ec4b8bf1ef2ca76e18fb32e..804a928876d05cb880d699e255789597781a6502:/src/xbt/memory_map.cpp diff --git a/src/xbt/memory_map.cpp b/src/xbt/memory_map.cpp index 4484dfee55..44d6fb2f11 100644 --- a/src/xbt/memory_map.cpp +++ b/src/xbt/memory_map.cpp @@ -1,8 +1,9 @@ -/* Copyright (c) 2008-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2008-2020. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include #include #include #include @@ -162,7 +163,7 @@ std::vector get_memory_map(pid_t pid) /* to be returned. */ std::string path = std::string("/proc/") + std::to_string(pid) + "/maps"; std::ifstream fp; - fp.rdbuf()->pubsetbuf(0, 0); + fp.rdbuf()->pubsetbuf(nullptr, 0); fp.open(path); if (not fp) { std::perror("open failed"); @@ -181,7 +182,7 @@ std::vector get_memory_map(pid_t pid) /* Tokenize the line using spaces as delimiters and store each token in lfields array. We expect 5 tokens for 6 fields */ char* saveptr = nullptr; // for strtok_r() - char* lfields[6]; + std::array lfields; lfields[0] = strtok_r(line, " ", &saveptr); int i;