Yeah you're right mate. I never liked this code. This was me trying to be smart and remove the need for malloc. I think I'll just revamp it to allocate enough memory up front.