Changed void * into char * for offset calculations to make things portable