Simplify by using openpam_straddch(3) to bootstrap the string.

git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@635 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
Dag-Erling Smørgrav 2013-03-03 23:23:58 +00:00
parent 54d9167cea
commit 75420a1e07
1 changed files with 2 additions and 4 deletions

View File

@ -62,11 +62,9 @@ openpam_readline(FILE *f, int *lineno, size_t *lenp)
size_t len, size;
int ch;
if ((line = malloc(size = MIN_LINE_LENGTH)) == NULL) {
openpam_log(PAM_LOG_ERROR, "malloc(): %m");
line = NULL;
if (openpam_straddch(&line, &size, &len, 0) != 0)
return (NULL);
}
len = 0;
for (;;) {
ch = fgetc(f);
/* strip comment */