File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -145,11 +145,15 @@ static void * audio_cap_jack_init(struct module *parent, const char *cfg)
145145 jack_status_t status ;
146146 const char * * ports ;
147147 int i ;
148- char * client_name ;
148+ char client_name [ STR_LEN ] ;
149149 const char * source_name = NULL ;
150150
151- client_name = alloca (MAX (strlen (PACKAGE_NAME ), strlen (cfg )) + 1 );
152- strcpy (client_name , PACKAGE_NAME );
151+ snprintf_ch (client_name , "%s" , PACKAGE_NAME );
152+
153+ if (strcmp (cfg , "help" ) == 0 ) {
154+ audio_cap_jack_help (client_name );
155+ return INIT_NOERR ;
156+ }
153157
154158 struct state_jack_capture * s = (struct state_jack_capture * ) calloc (1 , sizeof (struct state_jack_capture ));
155159 if (!s ) {
@@ -167,12 +171,7 @@ static void * audio_cap_jack_init(struct module *parent, const char *cfg)
167171 assert (dup != NULL );
168172 char * tmp = dup , * item , * save_ptr ;
169173 while ((item = strtok_r (tmp , ":" , & save_ptr )) != NULL ) {
170- if (strcmp (item , "help" ) == 0 ) {
171- audio_cap_jack_help (client_name );
172- free (dup );
173- free (s );
174- return INIT_NOERR ;
175- } else if (strstr (item , "first_channel=" ) == item ) {
174+ if (strstr (item , "first_channel=" ) == item ) {
176175 char * endptr ;
177176 char * val = item + strlen ("first_channel=" );
178177 errno = 0 ;
You can’t perform that action at this time.
0 commit comments