Made all the assert() lines which check the valuenode sub-parameter index range the...
[synfig.git] / synfig-core / trunk / src / synfig / valuenode_twotone.cpp
index f92b1ce..497af2e 100644 (file)
@@ -116,7 +116,8 @@ synfig::ValueNode_TwoTone::operator()(Time t)const
 bool
 ValueNode_TwoTone::set_link_vfunc(int i,ValueNode::Handle x)
 {
-       assert(i>=0 && i<3);
+       assert(i>=0 && i<link_count());
+
        switch(i)
        {
                case 0:
@@ -133,7 +134,8 @@ ValueNode_TwoTone::set_link_vfunc(int i,ValueNode::Handle x)
 ValueNode::LooseHandle
 ValueNode_TwoTone::get_link_vfunc(int i)const
 {
-       assert(i>=0 && i<3);
+       assert(i>=0 && i<link_count());
+
        switch(i)
        {
                case 0:
@@ -153,7 +155,8 @@ ValueNode_TwoTone::link_count()const
 String
 ValueNode_TwoTone::link_local_name(int i)const
 {
-       assert(i>=0 && i<2);
+       assert(i>=0 && i<link_count());
+
        switch(i)
        {
                case 0:
@@ -168,7 +171,8 @@ ValueNode_TwoTone::link_local_name(int i)const
 String
 ValueNode_TwoTone::link_name(int i)const
 {
-       assert(i>=0 && i<2);
+       assert(i>=0 && i<link_count());
+
        switch(i)
        {
                case 0: