krimdomu/Rex — pull request #312 by sbertrang (2014-02-14 18:31:39+00:00)
Title: do not call sprintf on undefined values to prevent warnings

On FreeBSD (and OpenBSD which inherits from that class) interfaces without assigned ip address lead to a bunch of warnings:

Use of uninitialized value in pack at /home/simon/Code/Rex/lib/Rex/Hardware/Network/FreeBSD.pm line 35, <> line 15.
Missing argument in sprintf at /home/simon/Code/Rex/lib/Rex/Hardware/Network/FreeBSD.pm line 35, <> line 15.
Missing argument in sprintf at /home/simon/Code/Rex/lib/Rex/Hardware/Network/FreeBSD.pm line 35, <> line 15.
Missing argument in sprintf at /home/simon/Code/Rex/lib/Rex/Hardware/Network/FreeBSD.pm line 35, <> line 15.
Missing argument in sprintf at /home/simon/Code/Rex/lib/Rex/Hardware/Network/FreeBSD.pm line 35, <> line 15.

With this commit pack() and sprintf() are only called with actual values and the warnings are gone.

Cheers,
Simon