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

@ -1,3 +1,9 @@
2013-07-29 Brad Hubbard <badone-guest@alioth.debian.org>
* lib/groupio.c: add newline char when two lines
are concatenated
Closes: alioth#313942
2013-07-28 Guido Trentalancia <guido@trentalancia.com> 2013-07-28 Guido Trentalancia <guido@trentalancia.com>
* etc/login.defs: fix typographic errors and use a better format * etc/login.defs: fix typographic errors and use a better format

View File

@ -329,7 +329,7 @@ static /*@null@*/struct commonio_entry *merge_group_entries (
} }
/* Concatenate the 2 lines */ /* 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*)); new_line = (char *)malloc ((new_line_len + 1) * sizeof(char*));
if (NULL == new_line) { if (NULL == new_line) {
errno = ENOMEM; errno = ENOMEM;