From: Augustin Degomme Date: Tue, 14 May 2019 13:44:48 +0000 (+0200) Subject: replace useless strncpy by a memcpy X-Git-Tag: v3.22.4~127^2~20 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a5fb710f275120ff77eb22dd342d274e54388639?hp=792b5dae11c1bd04ff4cd2a478cea5ad697720e4 replace useless strncpy by a memcpy --- diff --git a/src/smpi/bindings/smpi_pmpi.cpp b/src/smpi/bindings/smpi_pmpi.cpp index b4a47ddb8b..a20a5ff5b1 100644 --- a/src/smpi/bindings/smpi_pmpi.cpp +++ b/src/smpi/bindings/smpi_pmpi.cpp @@ -222,7 +222,7 @@ int PMPI_Error_string(int errorcode, char* string, int* resultlen){ FOREACH_ERROR(GENERATE_STRING) }; *resultlen = strlen(smpi_error_string[errorcode]); - strncpy(string, smpi_error_string[errorcode], *resultlen); + memcpy(string, smpi_error_string[errorcode], *resultlen*sizeof(char)); return MPI_SUCCESS; } }