********>Bugfix 7 Author: Jianyin Shao Date: 06/05/2008 Programs: ptraj Description: The bug in PtrajClusteringGetAttributeArrayCount() of cluster.c may point to an empty pointer, therefore could cause a runtime error. The other bug in mask.c will falsely issue a warning for "*" for empty mask, this bug will not cause any error. Fix: This patch acctually affects multiple files. So, run it from the $AMBERHOME directory, with: $ patch -p0 -N -r patch_rejects < bugfix.6 ------------------------------------------------------------------------------ diff -Naur oldamber/src/ptraj/cluster.c newamber/src/ptraj/cluster.c --- src/ptraj/cluster.c 2008-02-22 10:52:34.000000000 -0700 +++ src/ptraj/cluster.c 2008-06-05 15:13:21.000000000 -0600 @@ -6513,7 +6513,7 @@ Cluster* NewCluster; int PointInCluster; int ClusterCount = This->ClusterCount; - int AttributeCount = PtrajClusteringGetAttributeArrayCount(This); + int AttributeCount = PtrajClusteringGetAttributeCount(This); int i, j, k, diff; int* AttributeDifference; @@ -6806,8 +6806,8 @@ ClusterFindBestP2C( (PtrajCluster *) Node->Cluster); Node = Node->pNext; } - PtrajClusteringSOMExtractDifference( (PtrajClustering *) This, SOMNodes); /* print out significant differences in attributes between clusters. */ + if (prnlev >6) PtrajClusteringSOMExtractDifference( (PtrajClustering *) This, SOMNodes); /* print out significant differences in attributes between clusters. */ } /* diff -Naur oldamber/src/ptraj/cluster.c newamber/src/ptraj/mask.c --- src/ptraj/mask.c 2008-02-22 10:52:34.000000000 -0700 +++ src/ptraj/mask.c 2008-06-05 15:13:21.000000000 -0600 @@ -397,8 +397,8 @@ flag = 1; n++; } else if ( *p == ']' ) { - if ( n < 3 ) - printf("Warning: empty token?\n"); + if ( n < 3 && *(p-1) != '*' ) + printf("Warning: \'%c\' empty token?\n", *(p-1)); flag = 0; n = 0; } else { ------------------------------------------------------------------------------ Temporary workarounds: none