Fix an off-by-one bug that would in some circumstances trim off the

last character of a configuration line.

Sponsored by:	DARPA, NAI Labs


git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@49 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
Dag-Erling Smørgrav 2002-02-13 00:34:23 +00:00
parent fad3985e61
commit f62e36ce55
1 changed files with 1 additions and 1 deletions

View File

@ -132,7 +132,7 @@ _pam_read_policy_file(pam_handle_t *pamh,
/* strip comments and trailing whitespace */
if ((p = strchr(buf, '#')) != NULL)
len = p - buf ? p - buf - 1 : p - buf;
while (len > 0 && isspace(buf[len]))
while (len > 0 && isspace(buf[len - 1]))
--len;
if (len == 0)
continue;