There is a simple way to decide what a dogs intentions are if you have a pistol.
Squat down and extend the pistol out as far as you can reach. The dog will try to bite the nearest thing to him. If he bites the pistol,pull the trigger and you don't have to worry about missing or where the bullet went.
If the dog stops before that, No Harm Done.
That has to be some of the poorest advice I have ever heard.
You have never been attacked Right?? I have, so I would tell folks to never follow that advice.
If the dog was a pit, a rottweiler, or other large dog it could have you by the throat before you could react at an arms length. It could even kill you after you fired and hit it assuming you were fast enough. By Squatting down you are making you face, neck, and head more vulnerable, you are also encouraging a dog to attack by placing your face at eye level. A dog will perceive this as a direct challenge to fight.
If a dog is running at you you hold your ground stand up tall to make yourself appear larger, yell and stamp you feet, this will make many dogs stop and bark rather than attack. Most dogs aren't attack dogs and are just posturing. But if you think the dog is actually going to attack, and it keeps coming, you should probably trust your instincts. Its better that they grab a leg than your face and throat. You then have a chance to shoot if the dog doesn't break off the attack.
Jacob the fact that you trusted your instincts is probably what saved you from a mauling. When a dog is warning they will bark, the fact that the dog was charging you from behind and not barking means it was going to bite you. In my state the fact that the dog was at large at night/ or attacking off of a 6 foot lead, and the fact that you were not a criminal on the owner's property engaged in illegal activity, would have made it a good shoot. I suspect the law is the same in your state.