Dear list,

I found a bug, when defining a multiple option with default value. The value is assigned but the given variable is not increased:

else /* set the default value */
   {
     if (! args_info->seri_arg && ! args_info->seri_given)
       {
         args_info->seri_arg = (char * *) malloc (sizeof (char *));
         args_info->seri_arg [0] = gengetopt_strdup("/dev/ttyS1");
         args_info->seri_orig = (char **) malloc (sizeof (char *));
         args_info->seri_orig [0] = NULL;
         // here should the variable be increased
       }
   }

// here args_info->seri_given takes 0 value, so I can't access args_info->seri_arg
args_info->seri_given += local_args_info.seri_given;
local_args_info.seri_given = 0;

I use the latest version 2.19.1.

Best regards,
Yegor Yefremov



_______________________________________________
Help-gengetopt mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gengetopt

Reply via email to