aboutsummaryrefslogtreecommitdiff
path: root/diffcore-order.c
diff options
context:
space:
mode:
Diffstat (limited to 'diffcore-order.c')
-rw-r--r--diffcore-order.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/diffcore-order.c b/diffcore-order.c
index 2a4bd8232..23e93852d 100644
--- a/diffcore-order.c
+++ b/diffcore-order.c
@@ -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++;
}