Fix for issue #74

This commit should fix issue #74
code taken from the example code on man getifaddrs