Having earned my first tiny review privileges, I recently came across a late answer by a new user that had the code indented wrong and partially not at all. So I fixed it but then I looked at the answer and the question more closely and I'm convinced the code actually does not do what it's supposed to, so I downvoted.
Was this the right thing to do? Should I have left the formatting as it was and only downvote since the answer is wrong in my opinion? Should I maybe even have flagged it?