Simple: what is if(!found || --code) supposed to do?
Check if (!found) or (--code) is true.
(!found) is true, so there is no need to check for (--code), and so it will never get executed, unless (found) isn't 0.
It's c++'s default optimization.
If you reverse them into if(--code || !found) (--code) will be executed, and the result will be the one you expected.