********> bugfix.90 Author: Bill Ross Date: 3/11/97 Programs: Carnal Severity: Moderate Problem: Can crash in HBOND when specifying a DONOR group. Affects: Especially exactly defined hbond donor groups containing _only_ the donor (heavy) atoms. Cause: In sizing arrays it was not considered that heavy atoms can donate more than one covalently bound H to hbonds. Thus if the number of 'extra' H's on the donor atoms in the group exceeds the number of non-donor atoms, the program is likely to crash at some point during the calculation. Fix: Make the following change to hbond.c: --------------------------------------------------------------------- *** OLD hbond.c --- NEW hbond.c *************** *** 403,412 grp = grptr->idunion.group.Atomlist; grpend = (int *)( (int)grp + sizeof(int) * grptr->idunion.group.natoms); ! list1 = (int *) get(min(prm->Nbonh, grptr->idunion.group.natoms) ! * sizeof(int)); ! list2 = (int *) get(min(prm->Nbonh, grptr->idunion.group.natoms) ! * sizeof(int)); hbptr->idunion.hb.donor1 = list1; hbptr->idunion.hb.donor2 = list2; --- 403,410 ----- grp = grptr->idunion.group.Atomlist; grpend = (int *)( (int)grp + sizeof(int) * grptr->idunion.group.natoms); ! list1 = (int *) get(prm->Nbonh * sizeof(int)); ! list2 = (int *) get(prm->Nbonh * sizeof(int)); hbptr->idunion.hb.donor1 = list1; hbptr->idunion.hb.donor2 = list2; --------------------------------------------------------------------- Temporary workarounds: include attached H's in donor group --