Maggots only eat dead flesh -- they actually probably allowed him to live as long as he did to get rescued, else the infection would have killed him.

Tough little doggie!