Fix off-by-one error in 2781b4bea7db357be59f9a5fd73ca1eb12ff5a79.

Spotted by Tom Lane.