********> bugfix.22 Author: Bill Ross Date: 10/15/00 Programs: carnal Severity: moderate Description: Output of GROUP via COORD in RST form has bad format. Moreover, in both RST and PDB cases of GROUP output, the files aren't closed, leading to inability to open new ones once the process file descriptor limit is reached. Fix: Apply the following to coord.c: -------------------------------------------------------------------------- *** OLD coord.c --- NEW coord.c *************** *** 838,846 **** ixyz--; for (j=0; j<3; j++) { fprintf(file, "%12.7f", *++ixyz); - k++; if (!(k%6)) fprintf(file, "\n"); } } /* --- 838,846 ---- ixyz--; for (j=0; j<3; j++) { fprintf(file, "%12.7f", *++ixyz); if (!(k%6)) fprintf(file, "\n"); + k++; } } /* *************** *** 851,856 **** --- 851,857 ---- if (boxp) fprintf(file, "%12.7f%12.7f%12.7f\n", boxp[0], boxp[1], boxp[2]); + fclose(file); return; } *************** *** 954,959 **** --- 955,961 ---- crdp, prm); } } + fclose(file); return; } pdbgen(ixyz, idptr->idunion.crd.setp->prm, file, *************** *** 1142,1148 **** printf("starting new coord output file: %s\n", path); if ((file = fopen(path, "w")) == NULL) { perror(path); ! return(NULL); } return(file); } --- 1144,1150 ---- printf("starting new coord output file: %s\n", path); if ((file = fopen(path, "w")) == NULL) { perror(path); ! exit(1); } return(file); } --------------------------------------------------------------------------