]> AND Public Git Repository - simgrid.git/blobdiff - src/smpi/bindings/smpi_pmpi_info.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please codefactor
[simgrid.git] / src / smpi / bindings / smpi_pmpi_info.cpp
index 82634cfe771b249511bdfdea4a04194d248cb16b..0a694f22b17e90e36a2057603ad8e467f751a1e9 100644 (file)
@@ -34,8 +34,10 @@ int PMPI_Info_free( MPI_Info *info){
 
 int PMPI_Info_get(MPI_Info info, const char *key,int valuelen, char *value, int *flag){
   *flag=false;
-  if (info == nullptr || key == nullptr || valuelen <0)
+  if (info == nullptr || valuelen <0)
     return MPI_ERR_ARG;
+  if (key == nullptr)
+    return MPI_ERR_INFO_KEY;
   if (value == nullptr)
     return MPI_ERR_INFO_VALUE;
   return info->get(key, valuelen, value, flag);
@@ -68,8 +70,12 @@ int PMPI_Info_get_nthkey( MPI_Info info, int n, char *key){
 
 int PMPI_Info_get_valuelen( MPI_Info info, const char *key, int *valuelen, int *flag){
   *flag=false;
-  if (info == nullptr || key == nullptr || valuelen==nullptr)
+  if (info == nullptr)
     return MPI_ERR_ARG;
+  if (key == nullptr)
+    return MPI_ERR_INFO_KEY;
+  if (valuelen == nullptr)
+    return MPI_ERR_INFO_VALUE;
   return info->get_valuelen(key, valuelen, flag);
 }