somethere in the route you are witing a buffer that is bigger than the allocated space...
or wirting to the not-existing index of array... or something like that
it also explains randomness of the error - it occures when you trying to read the garbage, not when you put it there...
But the buffer overrun should then be in the intToString() function? As it is only when I add that I get the error.
No. It could be anywhere else... In the function where the crash occures - you just go to read the corrupted memory...
Originally Posted by h3ro
And adding or removing part of the code just moves the corrupted block up and down along the heap or stack - causing the crash to occure in different parts of the code
What compiler are you using? What is your warning level set to? Do you have a built-in debugger?