Fixed possible segfault

Also made a "magic number" a define, and fixed some formatting.
Added license information
Added man page
Merge branch 'master' of https://github.com/jockej/pwld