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:
parent
54d9167cea
commit
75420a1e07
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue