From ef60c2c8884b8432b176fe7b25a3ff0e4157498f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 30 Oct 2013 22:17:45 +0100 Subject: complain if hostname is empty --- mpd-notification.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mpd-notification.c b/mpd-notification.c index d439157..7e5b582 100644 --- a/mpd-notification.c +++ b/mpd-notification.c @@ -74,6 +74,10 @@ int main(int argc, char ** argv) { return EXIT_SUCCESS; case 'H': mpd_host = argv[i] + 2; + if (strlen(mpd_host) == 0) { + fprintf(stderr, "No host given!\n"); + return EXIT_FAILURE; + } printf("%s: using host %s\n", program, mpd_host); break; default: -- cgit v1.2.3-70-g09d2