This is the wording in Muslim; Al-Bukhari wording is a bit short.
Commentary: Seeing, listening, walking, etc., are means of committing the sin of fornication and adultery, but they have been termed so metaphorically so that every Muslim saves himself from them. If he does not try to save himself from them, his desires will find support from the private parts of his body; that is, he will incline to immoral acts. If he keeps himself away from the means of fornication and adultery, his private parts will crush his desires, that is to say he will be saved from immoral acts. This is the reason it is said that one should avoid glances, smiles, salutation, conversation, promises and then meetings which occur by stages on one's way to fornication and adultery.