Skip to content

Commit c261978

Browse files
committed
specify initial values for Boolean in struct optiont
Gave read of uninitilized Boolean value. Just a cleanup, no effect apart from observation via UB check.
1 parent da0b0d5 commit c261978

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/util/cmdline.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,19 @@ class cmdlinet
3939
protected:
4040
struct optiont
4141
{
42-
bool isset, hasval, islong;
42+
bool isset;
43+
bool hasval;
44+
bool islong;
4345
char optchar;
4446
std::string optstring;
4547
std::list<std::string> values;
48+
public:
49+
optiont():
50+
isset(false),
51+
hasval(false),
52+
islong(false),
53+
optchar(0)
54+
{}
4655
};
4756

4857
std::vector<optiont> options;

0 commit comments

Comments
 (0)