Fix off-by-one error when parsing diff output