X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fbcf6ab31cae1988be858f9f894dafe529c575d7..e849e1972a7b33aa47d7ec35420e66b7bca9ccba:/src/xbt/memory_map.cpp diff --git a/src/xbt/memory_map.cpp b/src/xbt/memory_map.cpp index 43ce328624..57eced3369 100644 --- a/src/xbt/memory_map.cpp +++ b/src/xbt/memory_map.cpp @@ -1,4 +1,4 @@ -/* 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. */ @@ -162,7 +162,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"); @@ -197,7 +197,7 @@ std::vector get_memory_map(pid_t pid) /* Ok we are good enough to try to get the info we need */ /* First get the start and the end address of the map */ - char* tok = strtok_r(lfields[0], "-", &saveptr); + const char* tok = strtok_r(lfields[0], "-", &saveptr); if (tok == nullptr) { std::fprintf(stderr, "Start and end address of the map are not concatenated by a hyphen (-). Recovery impossible.\n");