Commit af04b127 authored by Johannes Schindelin's avatar Johannes Schindelin Committed by Junio C Hamano

fmt-merge-msg: fix off-by-one bug

Thanks to the recent malloc()->xmalloc() change, and XMALLOC_POISON, this bug
was found.
Signed-off-by: Johannes Schindelin's avatarJohannes Schindelin <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent 8c02eee2
......@@ -142,7 +142,7 @@ static int handle_line(char *line)
if (origin[0] == '\'' && origin[len - 1] == '\'') {
char *new_origin = xmalloc(len - 1);
memcpy(new_origin, origin + 1, len - 2);
new_origin[len - 1] = 0;
new_origin[len - 2] = 0;
origin = new_origin;
} else
origin = strdup(origin);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment