From: Sam Moore Date: Sun, 5 Oct 2014 08:21:06 +0000 (+0800) Subject: Invalid array indices are not cool X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=63e9d774c858dfe79264a24ae8daa3dde3c7bb6e;p=ipdf%2Fcode.git Invalid array indices are not cool --- diff --git a/src/document.cpp b/src/document.cpp index f4f306e..d8466dd 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -443,11 +443,11 @@ done: // matches is not amused, but sulix is nice and moved it inside the #ifdef m_count++; PropagateQuadChanges(qti); } -#else // Although empty documents do always render correctly at any zoom, - // I suspect the markers will not be amused - m_count++; + 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)