X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain.c;h=800e8d1dd397a78ff8a75f8ea9e97f82065a7bf6;hb=c2560bd51498fb38e645b60ae638e2e888c74b65;hp=74e8745e4a1d768531f00fc0b693b1834e9198f3;hpb=369b595ca0a618ba8188d92ae26c4219625caa3d;p=src%2Fapp-framework-binder.git diff --git a/src/main.c b/src/main.c index 74e8745e..800e8d1d 100644 --- a/src/main.c +++ b/src/main.c @@ -117,7 +117,7 @@ static AFB_options cliOptions [] = { {SET_MODE ,1,"mode" , "set the mode: either local, remote or global"}, {SET_READYFD ,1,"readyfd" , "set the #fd to signal when ready"}, - {0, 0, 0} + {0, 0, NULL, NULL} }; static AFB_aliasdir aliasdir[MAX_ALIAS]; @@ -290,7 +290,7 @@ int main(int argc, char *argv[]) { // build GNU getopt info from cliOptions nbcmd = sizeof (cliOptions) / sizeof (AFB_options); - gnuOptions = malloc (sizeof (ggcOption) * nbcmd); + gnuOptions = malloc (sizeof (ggcOption) * (unsigned)nbcmd); for (ind=0; ind < nbcmd;ind++) { gnuOptions [ind].name = cliOptions[ind].name; gnuOptions [ind].has_arg = cliOptions[ind].has_arg; @@ -354,7 +354,7 @@ int main(int argc, char *argv[]) { aliascount++; } } else { - fprintf(stderr, "Too many aliases [max:%s] %s ignored\n", optarg, MAX_ALIAS-1); + fprintf(stderr, "Too many aliases [max:%d] %s ignored\n", MAX_ALIAS, optarg); } break; @@ -401,7 +401,7 @@ int main(int argc, char *argv[]) { case SET_USERID: if (optarg == 0) goto needValueForOption; - if (!sscanf (optarg, "%s", &cliconfig.setuid)) goto notAnInteger; + cliconfig.setuid = optarg; break; case SET_FAKE_MOD: @@ -662,14 +662,10 @@ errSessiondir: fprintf (stderr,"\nERR:AFB-daemon cannot read/write session dir\n\n"); exit (-1); -errSoundCard: - fprintf (stderr,"\nERR:AFB-daemon fail to probe sound cards\n\n"); - exit (-1); - exitInitLoop: // try to unlink pid file if any if (session->background && session->config->pidfile != NULL) unlink (session->config->pidfile); exit (-1); -}; /* END AFB-daemon() */ +} /* END AFB-daemon() */