From 90aa31f25a893303cd2884e66acd76c1bc57d976 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 24 Jun 2021 13:43:30 +0200 Subject: [PATCH] [sonar] Avoid C-style array. --- src/smpi/mpi/smpi_comm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/smpi/mpi/smpi_comm.cpp b/src/smpi/mpi/smpi_comm.cpp index 5c23877104..2dceee2898 100644 --- a/src/smpi/mpi/smpi_comm.cpp +++ b/src/smpi/mpi/smpi_comm.cpp @@ -183,12 +183,12 @@ void Comm::get_name(char* name, int* len) const std::string Comm::name() const { int size; - char name[MPI_MAX_NAME_STRING+1]; - this->get_name(name, &size); + std::array name; + this->get_name(name.data(), &size); if (name[0]=='\0') return std::string("MPI_Comm"); else - return std::string(name); + return std::string(name.data()); } -- 2.20.1