Invalid array indices are not cool
[ipdf/code.git] / src / document.cpp
index ffe3b8a..d8466dd 100644 (file)
@@ -439,12 +439,15 @@ unsigned Document::Add(ObjectType type, const Rect & bounds, unsigned data_index
                        m_quadtree.nodes[new_qti].next_overlay = overlay;
                        new_qti = overlay;
                }
-done:
+done: // matches is not amused, but sulix is nice and moved it inside the #ifdef for him.
                m_count++;
                PropagateQuadChanges(qti);
        }
+       return m_count;
+#else // words fail me (still not amused)
+       return (m_count++);
 #endif
-       return m_count; // Why can't we just use the size of types or something?
+       
 }
 
 unsigned Document::AddBezierData(const Bezier & bezier)

UCC git Repository :: git.ucc.asn.au