Re: [AMBER-Developers] bug in ptraj.c (AmberTools 1.3)

From: Scott Brozell <sbrozell.rci.rutgers.edu>
Date: Mon, 22 Feb 2010 12:26:47 -0500

Hi,

On Mon, Feb 22, 2010 at 12:20:05PM -0500, Daniel Roe wrote:
> This is fortunately not to big an issue, but it's always good to be thorough
> when it comes to keeping track of pointers.
>
> The line should read :
>
> if (parm!=NULL) clearParm(parm);
>
> since I believe the parm structure is not initialized if non-amber top is
> used. I will check this in to the CVS tree after testing.

That fix would be consistent with the other ptraj calls of clearParm.
However, I
changed the function clearParm so that it handles a NULL pointer argument.
Since that is idiomatic C (and thus less error prone),
it is preferred to pre-checking the argument.

Thanks for the report,
Scott

> -Dan
>
> On Mon, Feb 22, 2010 at 11:57 AM, Hannes Loeffler <
> Hannes.Loeffler.stfc.ac.uk> wrote:
>
> > Hi,
> >
> > I think there is a bug in ptrajCleanup (ptraj.c) showing up in the last
> > line:
> >
> > clearParm(parm);
> >
> > Gdb tells me that parm is a null pointer when the function is called.
> > I should point out that I do not see this problem with AMBER top/crd
> > files but only with PSF/DCD input (NAMD generated).

_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Mon Feb 22 2010 - 09:30:04 PST
Custom Search