Closed abhimanyusirohi closed 9 years ago
The following code returns a NULL pointer for inchikey:
int mol = indigoLoadMoleculeFromString("C1CCCCC1"); const char* inchi = indigoInchiGetInchi(mol); // InChI=1S/C6H12/c1-2-4-6-5-3-1/h1-6H2 const char* inchik = indigoInchiGetInchiKey(inchi); // NULL pointer
The problem lies in indigoInchiGetInchiKey method of indigo_inchi_api.cpp file. The passed in inchi_string is somehow assigned to self.tmp_string which is cleared for output in IndigoInchi::InChIKey method of indigo_inchi_core.cpp.
Answered in the forum. The fix is to NOT use the "const char_" returned by _indigoInchiGetInchi* method and use a copy. https://groups.google.com/d/topic/indigo-bugs/Bxj7DF1IWfM/discussion
The following code returns a NULL pointer for inchikey:
The problem lies in indigoInchiGetInchiKey method of indigo_inchi_api.cpp file. The passed in inchi_string is somehow assigned to self.tmp_string which is cleared for output in IndigoInchi::InChIKey method of indigo_inchi_core.cpp.