OSDN Git Service

Undo of creating atoms caused segmentation fault; fixed.
authortoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Thu, 6 May 2010 15:13:26 +0000 (15:13 +0000)
committertoshinagata1964 <toshinagata1964@a2be9bc6-48de-4e38-9406-05402d4bc13c>
Thu, 6 May 2010 15:13:26 +0000 (15:13 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/molby/trunk@44 a2be9bc6-48de-4e38-9406-05402d4bc13c

MolLib/MainView.c

index d2d1a05..4f4d953 100755 (executable)
@@ -2275,7 +2275,7 @@ MainView_mouseMoved(MainView *mview, const float *mousePos, int flags)
 static int
 sCreateNewAtom(Molecule *mol, Vector pos)
 {
-       int i, j;
+       Int i, j;
        Atom a;
        char name[6];
        memset(&a, 0, sizeof(Atom));
@@ -2295,7 +2295,7 @@ sCreateNewAtom(Molecule *mol, Vector pos)
        a.type = AtomTypeEncodeToUInt("c3");
        a.weight = WeightForAtomicNumber(a.atomicNumber);
        a.r = pos;
-       if (MolActionCreateAndPerform(mol, gMolActionAddAnAtom, &a, -1) == 0)
+       if (MolActionCreateAndPerform(mol, gMolActionAddAnAtom, &a, -1, &i) == 0)
                return mol->natoms - 1;
        else return -1;
 /*     return MoleculeAddAtom(mol, &a); */