hexdump routine needs to null terminate at the right place