My pokemon always seem to hurt themselves when confused :S
The confused condition causes a Pokémon to hurt itself in its confusion 50% of the time. The damage is done as if the Pokémon attacked itself with a 40-power typeless physical attack. Confusion wears off after 1-4 attacking turns.
Straight from bulbapedia.And with Prankster its priority :)
Since Gen 7, Confusion now has a 1/3 chance of activating.
Since the previous answer was posted in 2011, they didn't get it wrong, Gamefreak just changed it since then.
Source: Wolfey VGC videos