malloc(), realloc().. the dark side powerful it is

Hmm, this seems like a typical result of trying to make things "simpler" my making them more obscure.
It's hard to get things in the right place if it's going to quietly move things elsewhere before compiling.

Thanks for the explanation.

I added tabs for the .h and .c but now it fails with "unterminated endif"

When I look at the tab with memdebug.c I can see why.

at line 89 onwards everything has become concatenated onto one !!

The result is that the terminating #endif // DEBUG is not at the beginning of a line and does not get parsed correctly.

Not only does it copy stuff elsewhere, it mangles the source before doing so.

Is there a 90 line limits to tabs ???