Did I do the right thing?

I posted last night about my guy friend sending me mixed messages. I took the advice I got and told him he shouldn't treat me like a girlfriend (flirting, talking about sleeping with me) if I'm not and just because his past relationships failed doesn't mean ours would. Now he seems upset and distant. Did I do the right thing?