use xmemdupz() to allocate copies of strings given by start and length