Hi Hannes, >> + if (size == 0) >> + size = 1; >> ret = realloc (ptr, sz); > > I think you meant to use sz here instead of size. Doh! Yes, thanks for the catch. Cheers Nick