minissdpd.c: fix usage messages

fixes #575
This commit is contained in:
Thomas Bernard 2021-11-05 00:08:42 +01:00
parent d0fb9577fb
commit f91824c270
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF
1 changed files with 11 additions and 3 deletions

View File

@ -1288,7 +1288,11 @@ int main(int argc, char * * argv)
break; break;
} }
if(parselanaddr(lan_addr, argv[++i]) != 0) { if(parselanaddr(lan_addr, argv[++i]) != 0) {
fprintf(stderr, "can't parse \"%s\" as a valid address or interface name\n", argv[i]); fprintf(stderr, "can't parse \"%s\" as a valid "
#ifndef ENABLE_IPV6
"address or "
#endif
"interface name\n", argv[i]);
free(lan_addr); free(lan_addr);
} else { } else {
LIST_INSERT_HEAD(&lan_addrs, lan_addr, list); LIST_INSERT_HEAD(&lan_addrs, lan_addr, list);
@ -1323,8 +1327,12 @@ int main(int argc, char * * argv)
"-i <interface> [-i <interface2>] ...\n", "-i <interface> [-i <interface2>] ...\n",
argv[0]); argv[0]);
fprintf(stderr, fprintf(stderr,
"\n <interface> is either an IPv4 address with mask such as\n" "\n <interface> is "
" 192.168.1.42/255.255.255.0, or an interface name such as eth0.\n"); #ifndef ENABLE_IPV6
"either an IPv4 address with mask such as\n"
" 192.168.1.42/255.255.255.0, or "
#endif
"an interface name such as eth0.\n");
fprintf(stderr, fprintf(stderr,
"\n By default, socket will be open as %s\n" "\n By default, socket will be open as %s\n"
#ifndef NO_BACKGROUND_NO_PIDFILE #ifndef NO_BACKGROUND_NO_PIDFILE