3 cables in one box wiring issue
Sounds okay to me. I'm guessing one cable is the feed to the box, another goes to the switch, and the final cable goes off to some other part of the circuit.  The black wire in the cable going to the switch, is connected to the black feed wire. The white wire in the cable going to the switch, brings switched power back to the fixture. Since the cable only has two wires, the white was repurpsed to be the switched "hot" lead. This is fine, though the wire should be marked in some way at both ends to indicate that it's no longer a "neutral".

This is what the circuit looks like.