Use memmove to adjust the buffer otherwise we'll corrupt the data in it