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 <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Johannes Schindelin 2006-09-01 10:49:29 +02:00 committed by Junio C Hamano
parent 8c02eee29e
commit af04b12710

View File

@ -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);