Fix count for ranges truncated in remove_range().

* lib/subordinateio.c: Fix count for ranges truncated in
	remove_range().
This commit is contained in:
Nicolas François 2013-08-13 22:29:16 +02:00
parent 8781aff637
commit 0094abea6e
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2013-08-13 Nicolas François <nicolas.francois@centraliens.net>
* lib/subordinateio.c: Fix count for ranges truncated in
remove_range().
2013-08-13 Nicolas François <nicolas.francois@centraliens.net>
* src/su.c: Terminate the child (if needed) before closing the PAM

View File

@ -323,7 +323,7 @@ static int remove_range(struct commonio_db *db,
}
/* Is just the end of the entry removed? */
else if ((start > first) && (end >= last)) {
range->count = (start - range->start) + 1;
range->count = start - range->start;
ent->changed = true;
db->changed = true;
@ -338,7 +338,7 @@ static int remove_range(struct commonio_db *db,
if (!commonio_append(db, &tail))
return 0;
range->count = (start - range->start) + 1;
range->count = start - range->start;
ent->changed = true;
db->changed = true;