a bug, when defining a multiple option with default value

Yegor Yefremov <[email protected]>
Newsgroups gmane.comp.gnu.gengetopt.general
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.