Fixes #1532, SEGV in g_current.
authorDavid van der Spoel <spoel@xray.bmc.uu.se>
Sat, 28 Jun 2014 07:33:55 +0000 (09:33 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sun, 29 Jun 2014 05:43:58 +0000 (07:43 +0200)
Unfortunately the tool does not do anything useful at this point
in time it seems, it just produces one graph that is non-zero

Change-Id: Ie991b8200628253ab308d36cb5afc80138b1acff

src/tools/gmx_current.c

index efa25a3d4a22e7d0df3ad3802e58d6625c3beeb7..2e5ae17d9afc410b1af3c2a8b2aeaf815e5c4cb0 100644 (file)
@@ -728,7 +728,7 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
 
 
 
-    if (bACF)
+    if (bACF && (ii < nvfr))
     {
         fprintf(stderr, "Integral and integrated fit to the current acf yields at t=%f:\n", time[vfr[ii]]);
         fprintf(stderr, "sigma=%8.3f (pure integral: %.3f)\n", sgk-malt*pow(time[vfr[ii]], sigma), sgk);
@@ -763,7 +763,7 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor,
     }
     else
     {
-        fprintf(stderr, "Too less points for a fit.\n");
+        fprintf(stderr, "Too few points for a fit.\n");
     }