[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[help-gengetopt] a bug, when defining a multiple option with default val
From: |
Yegor Yefremov |
Subject: |
[help-gengetopt] a bug, when defining a multiple option with default value |
Date: |
Tue, 12 Jun 2007 10:18:37 +0200 |
User-agent: |
Thunderbird 2.0.0.0 (Windows/20070326) |
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] a bug, when defining a multiple option with default value,
Yegor Yefremov <=