Although I have no idea since I have never seen the code, I'm pretty sure there's no way to hit a bomb on your first click. I'm played enough (MS Windows) Minesweeper and have never, ever hit a bomb on the first click.
As a side note, Minesweeper the first game I ever programmed was for my intro C class in college using SRGP[1] as the graphics library. Thinking back, it was a tough project. The Minesweeper logic wasn't so bad but doing the graphics was the most work. In hindsight, it shouldn't have taken more than a couple hours to code but took everyone a fair amount of time. Of course we didn't know what they hell we were doing. Fun stuff.
EDIT: After searching around it appears there is code to prevent the first-click bomb in a rather novel way[2].
[1] http://www.niksula.cs.hut.fi/~tik86120/X_srgp.html [2] http://www.sanchitkarve.com/blog/2009/01/does-minesweeper-ch...