From: Juho Vähä-Herttua Date: Sun, 14 Apr 2013 19:04:21 +0000 (+0300) Subject: Remove some redundant code from shairplay CLI X-Git-Tag: upstream/0.9.0~4^2~22 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=093f6e0042a9e1d673052d7dbf35508c3f305bb6;p=deb_shairplay.git Remove some redundant code from shairplay CLI --- diff --git a/src/shairplay.c b/src/shairplay.c index bf269ef..9bb9537 100644 --- a/src/shairplay.c +++ b/src/shairplay.c @@ -226,7 +226,8 @@ parse_options(shairplay_options_t *opt, int argc, char *argv[]) char *path = argv[0]; char *arg; - strcpy(opt->apname, "Shairplay"); + /* Set default values for apname and port */ + strncpy(opt->apname, "Shairplay", sizeof(opt->apname)-1); opt->port = 5000; while ((arg = *++argv)) { @@ -264,13 +265,6 @@ parse_options(shairplay_options_t *opt, int argc, char *argv[]) } } - /* Set default values for apname and port */ - if (!strlen(opt->apname)) { - strncpy(opt->apname, "Shairplay", sizeof(opt->apname)-1); - } - if (!opt->port) { - opt->port = 5000; - } return 0; }