-
由 Pierre Habouzit 提交于
A lot of places in git's code use code like: char *res; len = ... find length of an interesting segment in src ...; res = xmalloc(len + 1); memcpy(res, src, len); res[len] = '\0'; return res; A new function xmemdupz() captures the allocation, copy and NUL termination. Existing xstrndup() is reimplemented in terms of this new function. Signed-off-by: NPierre Habouzit <madcoder@debian.org> Signed-off-by: NJunio C Hamano <gitster@pobox.com>
68d3025a