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:
parent
fad3985e61
commit
f62e36ce55
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue