exit without crashing when empdd is run manually with --option

fix T2591
This commit is contained in:
Mike Blumenkrantz 2015-11-24 21:31:38 -05:00
parent fc7b9ff717
commit fd7ae69962
1 changed files with 8 additions and 0 deletions

View File

@ -1387,6 +1387,14 @@ main(int argc, char *argv[])
{
struct mpd_settings *settings = NULL;
const char *h, *pass, *p = NULL;
int i;
for (i = 0; i < argc; i++)
if (argv[i][0] == '-')
{
fprintf(stderr, "USAGE: %s <HOST<:PORT>> <PORT>\n", argv[0]);
return 1;
}
pass = getenv("MPD_PASSWORD");
p = getenv("MPD_PORT");