add newline char when two lines are concatenated

This commit is contained in:
Brad Hubbard
2013-07-29 10:05:52 +02:00
committed by bubulle
parent d3b95d1d26
commit b10cba0e0a
2 changed files with 7 additions and 1 deletions

View File

@@ -329,7 +329,7 @@ static /*@null@*/struct commonio_entry *merge_group_entries (
}
/* Concatenate the 2 lines */
new_line_len = strlen (gr1->line) + strlen (gr2->line) +1;
new_line_len = strlen (gr1->line) + strlen (gr2->line) +2;
new_line = (char *)malloc ((new_line_len + 1) * sizeof(char*));
if (NULL == new_line) {
errno = ENOMEM;