mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Use xmemdupz() in many places.
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
39bd2eb56a
commit
182af8343c
@@ -48,11 +48,8 @@ static void prepare_order(const char *orderfile)
|
||||
if (*ep == '\n') {
|
||||
*ep = 0;
|
||||
order[cnt] = cp;
|
||||
}
|
||||
else {
|
||||
order[cnt] = xmalloc(ep-cp+1);
|
||||
memcpy(order[cnt], cp, ep-cp);
|
||||
order[cnt][ep-cp] = 0;
|
||||
} else {
|
||||
order[cnt] = xmemdupz(cp, ep - cp);
|
||||
}
|
||||
cnt++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user