X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3297da9f47ce18371941b2b48a2f4018b4793ced..6cf57242a375fb0186c9eefcf46fcff848d54b19:/src/smpi/bindings/smpi_f77_comm.cpp diff --git a/src/smpi/bindings/smpi_f77_comm.cpp b/src/smpi/bindings/smpi_f77_comm.cpp index 3e051e5207..750ea02a62 100644 --- a/src/smpi/bindings/smpi_f77_comm.cpp +++ b/src/smpi/bindings/smpi_f77_comm.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -102,7 +102,8 @@ void mpi_comm_free_keyval_ (int* keyval, int* ierr) { void mpi_comm_get_name_ (int* comm, char* name, int* len, int* ierr){ *ierr = MPI_Comm_get_name(simgrid::smpi::Comm::f2c(*comm), name, len); if(*len>0) - name[*len]=' '; + for(int i = *len; i=0 && name[count]==' '; count--); + count+=1; + char* tname = xbt_new(char, count+1); + strncpy(tname, name, count); + tname[count]='\0'; *ierr = MPI_Comm_set_name (simgrid::smpi::Comm::f2c(*comm), tname); xbt_free(tname); }