[PATCH 1/7] programs/cmd/tests: don't output more data than available