AMBER: top2mol2.c scanf format string bug

From: Chris Moth <chris.moth.vanderbilt.edu>
Date: Mon, 06 Nov 2006 18:19:36 -0600

In $AMBERHOME/src/antechamber/top2mol2.c there is this:

21: long crd_atomnum = 0;
....
194: sscanf(line, "%d", &crd_atomnum);


On one of our platforms, sizeof(long) == 8 and sizeof(int) == 4, and
line 194 is a bug.

Changing line 194 to %ld instead of %d as in:

194: sscanf(line, "%ld", &crd_atomnum);

allowed some antechamber tests to pass, tests which otherwise failed due
to residual binary junk in crd_atomnum.

Chris


-----------------------------------------------------------------------
The AMBER Mail Reflector
To post, send mail to amber.scripps.edu
To unsubscribe, send "unsubscribe amber" to majordomo.scripps.edu
Received on Wed Nov 08 2006 - 06:07:26 PST
Custom Search