Reading this thing made my head hurt.
I have seen a lot of code like this though.
Apparently this has made the rounds around the Internet but it is the first time I've seen it.
It's a nice HOWTO on writing unmanagable code.
Yep, unmanagable.
http://thc.org/root/phun/unmaintain.html
This was my favorite:
void* Realocate(void*buf, int os, int ns)
{
void*temp;
temp = malloc(os);
memcpy((void*)temp, (void*)buf, os);
free(buf);
buf = malloc(ns);
memset(buf, 0, ns);
memcpy((void*)buf, (void*)temp, ns);
return buf;
}