I believe its making its own copy:
Code:
int setatomgr(
struct chemical *chem)
{
/* prototypes */
int intsmi(char *,struct chemical *,int *);
int chkval();
int chkaro();
/* local variables */
int errpos;
int aok;
int i;
if (chem->seqnum <= 0) {
if (strlen(ErrorList) > 1) {
strcat(ErrorList,",");
}
strcat(ErrorList,"Internal error: setatomgr uninitialized chemical! ");
sprintf(ErrorList,"%s%d",ErrorList,chem->seqnum);
exit(1);
}
if (chem->seqnum != seqnum) {
/* its a new chemical. The global information
* is not yet set up for this chemical (yet)
*/
aok = intsmi(chem->smiles,chem,&errpos);
if (!aok) {
if (strlen(ErrorList) > 1) {
strcat(ErrorList,",");
}
strcat(ErrorList,"SMILES error detected at position:");
i = errpos - 1; /* pointer always points to next */
while (i > 0) {
i--;
}
strcat(ErrorList,"V");
sprintf(ErrorList,"%s%d",ErrorList,chem->smiles);
return(0); /* bad return */
} /* end, not ok results */
} /* if new chemical */
if (nhydro < 0) {
/* Implicit hydrogens are not defined yet */
aok = chkval();
aok &= chkaro();
if (!aok) {
if (strlen(ErrorList) > 1) {
strcat(ErrorList,",");
}
strcat(ErrorList,"Discovered problems in the structure of chemical");
sprintf(ErrorList,"%s%d",ErrorList,chem->seqnum);
sprintf(ErrorList,"%s%d",ErrorList,chem->smiles);
return(0); /* bad return */
}
}
return(1); /* good return */
}