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;
|
size_t len, size;
|
||||||
int ch;
|
int ch;
|
||||||
|
|
||||||
if ((line = malloc(size = MIN_LINE_LENGTH)) == NULL) {
|
line = NULL;
|
||||||
openpam_log(PAM_LOG_ERROR, "malloc(): %m");
|
if (openpam_straddch(&line, &size, &len, 0) != 0)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
|
||||||
len = 0;
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
ch = fgetc(f);
|
ch = fgetc(f);
|
||||||
/* strip comment */
|
/* strip comment */
|
||||||
|
|
Loading…
Reference in New Issue