From e38b14311d3182de4c7bd3b03dcdde8caa93a941 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Fri, 7 Jul 2017 17:22:12 +0200 Subject: [PATCH 1/1] [SMPI] Use std::string::compare instead of strncmp --- src/smpi/internals/smpi_memory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/smpi/internals/smpi_memory.cpp b/src/smpi/internals/smpi_memory.cpp index 9a1147f73d..4fce186361 100644 --- a/src/smpi/internals/smpi_memory.cpp +++ b/src/smpi/internals/smpi_memory.cpp @@ -108,7 +108,8 @@ void smpi_really_switch_data_segment(int dest) int smpi_is_privatization_file(char* file) { - return strncmp("/dev/shm/my-buffer-", file, std::strlen("/dev/shm/my-buffer-")) == 0; + const std::string buffer_path {"/dev/shm/my-buffer-"}; + return buffer_path.compare(file) == 0; } void smpi_initialize_global_memory_segments() -- 2.20.1