Skip to content

Commit 0ed10b4

Browse files
committed
Fix printf format specifier for double and MPI_Count
1 parent 549d5fe commit 0ed10b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mpi_t/varlist/varlist.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,8 @@ void list_cvars()
643643
{
644644
err=MPI_T_cvar_read(handle,&v_count);
645645
CHECKERR("CVARREAD",err);
646-
sprintf(value,"%lu",v_count);
646+
long long int v_count_l = v_count;
647+
sprintf(value,"%lld",v_count_l);
647648
}
648649
else if (dt==MPI_CHAR)
649650
{
@@ -655,7 +656,7 @@ void list_cvars()
655656
{
656657
err=MPI_T_cvar_read(handle,&v_double);
657658
CHECKERR("CVARREAD",err);
658-
sprintf(value,"%d",v_double);
659+
sprintf(value,"%f",v_double);
659660
}
660661
else
661662
{

0 commit comments

Comments
 (0)