File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
include/boost/program_options Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ namespace boost { namespace program_options {
24
24
basic_command_line_parser<charT>::
25
25
basic_command_line_parser (int argc, const charT* const argv[])
26
26
: detail::cmdline(
27
- to_internal (std::vector<std::basic_string<charT> >(argv+1 , argv+argc))),
27
+ to_internal (std::vector<std::basic_string<charT> >(argc ? argv+1 : argv , argv+argc))),
28
28
m_desc()
29
29
{}
30
30
Original file line number Diff line number Diff line change @@ -120,7 +120,11 @@ namespace boost { namespace program_options {
120
120
basic_command_line_parser (const std::vector<
121
121
std::basic_string<charT> >& args);
122
122
/* * Creates a command line parser for the specified arguments
123
- list. The parameters should be the same as passed to 'main'.
123
+ list. The parameters should be the same as passed to 'main', meaning:
124
+ @param argc Must be non-negative i.e. >= 0
125
+ @param argv Argv[argc] must be 0 e.g. nullptr and
126
+ if argc is >0 argv[0] up to argv[argc-1] must point to
127
+ null terminated strings
124
128
*/
125
129
basic_command_line_parser (int argc, const charT* const argv[]);
126
130
You can’t perform that action at this time.
0 commit comments