Fix a bug detected by the unit tests: to ensure consistent handling of

trailing whitespace, openpam_readword() should *always* push back the
last character read (which is a no-op in the EOF case).


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@550 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
Dag-Erling Smørgrav 2012-04-01 20:45:19 +00:00
parent d7708b3ae5
commit 49a4c1509e
1 changed files with 1 additions and 2 deletions

View File

@ -118,8 +118,7 @@ openpam_readword(FILE *f, int *lineno, size_t *lenp)
errno = EINVAL;
return (NULL);
}
if (ch == '\n')
ungetc(ch, f);
ungetc(ch, f);
if (lenp != NULL)
*lenp = len;
return (word);