fix for newer gcc that does not like pointer arithmetic