Jeff King <peff@xxxxxxxx> writes: > - len = strlen((const char *)data); > - next = data + len + 1; > - if (next > rd->end) > + eos = memchr(data, '\0', end - data); > + if (!eos || eos == end) > return -1; > + len = eos - data; > + next = eos + 1; Yup, much nicer. > - len = strlen((const char *)data); > - next = data + len + 1; > - if (next > rd->end) > + eos = memchr(data, '\0', end - data); > + if (!eos || eos == end) > return -1; > - untracked->untracked[i] = xstrdup((const char*)data); > + len = eos - data; > + next = eos + 1; > + untracked->untracked[i] = xmemdupz(data, len); Same here, too. Thanks.