Add support for transformation pull coordinates
[alexxy/gromacs.git] / src / gromacs / mdtypes / inputrec.cpp
index e54e8c3a7ce4eab1fac98754335bf08cde6563ff..09d85d86b1229ff5a1d6a262359969ad535ce3b2 100644 (file)
@@ -472,8 +472,6 @@ static void pr_pull_group(FILE* fp, int indent, int g, const t_pull_group* pgrp)
 
 static void pr_pull_coord(FILE* fp, int indent, int c, const t_pull_coord* pcrd)
 {
-    int g;
-
     pr_indent(fp, indent);
     fprintf(fp, "pull-coord %d:\n", c);
     PS("type", enumValueToString(pcrd->eType));
@@ -482,12 +480,10 @@ static void pr_pull_coord(FILE* fp, int indent, int c, const t_pull_coord* pcrd)
         PS("potential-provider", pcrd->externalPotentialProvider.c_str());
     }
     PS("geometry", enumValueToString(pcrd->eGeom));
-    for (g = 0; g < pcrd->ngroup; g++)
+    for (int g = 0; g < pcrd->ngroup; g++)
     {
-        char buf[STRLEN];
-
-        sprintf(buf, "group[%d]", g);
-        PI(buf, pcrd->group[g]);
+        std::string buffer = gmx::formatString("group[%d]", g);
+        PI(buffer.c_str(), pcrd->group[g]);
     }
     pr_ivec(fp, indent, "dim", pcrd->dim, DIM, TRUE);
     pr_rvec(fp, indent, "origin", pcrd->origin, DIM, TRUE);