changed memset to EOF