http output: fix off-by-one

(Coverity report 1187490)