Fix build problems on OS X.
Fix compilation warnings:
 - assignment used as condition warnings for the error checking
 - writeable char constant warning.
 - Fix sprintf of size_t values to not (potentially) print garbage.
 - Remove extra parentheses around condition in if().
 - Replace explicit NULL dereference by a call to abort().
Merge pull request #18 from abergeron/osx-build

closes #7 enhancement request

OS X build