Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] [PATCH 3/4] opal-ps: Use the return value from asprintf as the header length.
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2009-03-03 08:11:23


Done.

On Feb 19, 2009, at 7:29 AM, Bert Wesarg wrote:

> From: Bert Wesarg <Bert.Wesarg_at_[hidden]>
>
> asprintf returns the length of the written header, use this as the
> length.
>
> Regards,
> Bert Wesarg
>
> ---
>
> orte/tools/orte-ps/orte-ps.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --quilt old/orte/tools/orte-ps/orte-ps.c new/orte/tools/orte-ps/
> orte-ps.c
> --- old/orte/tools/orte-ps/orte-ps.c
> +++ new/orte/tools/orte-ps/orte-ps.c
> @@ -392,8 +392,7 @@ static int pretty_print(orte_ps_mpirun_i
> /*
> * Print header
> */
> - asprintf(&header, "Information from mpirun %s",
> ORTE_JOBID_PRINT(hnpinfo->hnp->name.jobid));
> - len_hdr = strlen(header);
> + len_hdr = asprintf(&header, "Information from mpirun %s",
> ORTE_JOBID_PRINT(hnpinfo->hnp->name.jobid));
>
> printf("\n\n%s\n", header);
> free(header);
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel

-- 
Jeff Squyres
Cisco Systems