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