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()
int status;
do {
- snprintf(path, sizeof(path), "/smpi-buffer-%06x", rand() % 0xffffff);
+ snprintf(path, sizeof(path), "/smpi-buffer-%06x", rand() % 0xffffffU);
file_descriptor = shm_open(path, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
} while (file_descriptor == -1 && errno == EEXIST);
if (file_descriptor < 0) {