From 7d098bff90d4d28fb3df22f0fcbb2d5edfda0746 Mon Sep 17 00:00:00 2001 From: Jakub Krajniak Date: Tue, 29 Nov 2016 12:47:19 +0100 Subject: [PATCH] update format (cherry picked from commit 2597185afb212cfa31c5d8364a9d059d8d216807) --- src/USER-MISC/dihedral_nharmonic.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/USER-MISC/dihedral_nharmonic.cpp b/src/USER-MISC/dihedral_nharmonic.cpp index 25049b8ec2..8def32bb35 100644 --- a/src/USER-MISC/dihedral_nharmonic.cpp +++ b/src/USER-MISC/dihedral_nharmonic.cpp @@ -342,11 +342,10 @@ void DihedralNHarmonic::read_restart(FILE *fp) void DihedralNHarmonic::write_data(FILE *fp) { - fwrite(&nterms[1],sizeof(int),atom->ndihedraltypes,fp); for (int i = 1; i <= atom->ndihedraltypes; i++) { fprintf(fp, "%d %d ", i, nterms[i]); for (int j = 0; j < nterms[i]; j++ ) { - fprintf(fp, "%f ", a[i][j]); + fprintf(fp, (j < nterms[i] - 1) ? "%f " : "%f", a[i][j]); } fprintf(fp, "\n"); }