From: Berk Hess Date: Wed, 13 May 2015 10:11:34 +0000 (+0200) Subject: Fix segv in g_covar X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=34ef2b1bef4ac4ab866162b596994a1cca36b717;p=alexxy%2Fgromacs.git Fix segv in g_covar With fewer trajectory frames than #DOF in the analysis group, g_covar would print a warning to a NULL pointer instead of stderr. Fixes #1733. Change-Id: I546f867d7d95f418212bb5b65005f62de71bdfb8 --- diff --git a/src/gromacs/gmxana/gmx_covar.c b/src/gromacs/gmxana/gmx_covar.c index f3e575f228..37e9a893cc 100644 --- a/src/gromacs/gmxana/gmx_covar.c +++ b/src/gromacs/gmxana/gmx_covar.c @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -556,9 +556,9 @@ int gmx_covar(int argc, char *argv[]) if (nframes-1 < ndim) { end = nframes-1; - fprintf(out, "WARNING: there are fewer frames in your trajectory than there are\n"); - fprintf(out, "degrees of freedom in your system. Only generating the first\n"); - fprintf(out, "%d out of %d eigenvectors and eigenvalues.\n", end, (int)ndim); + fprintf(stderr, "\nWARNING: there are fewer frames in your trajectory than there are\n"); + fprintf(stderr, "degrees of freedom in your system. Only generating the first\n"); + fprintf(stderr, "%d out of %d eigenvectors and eigenvalues.\n", end, (int)ndim); } else {