Skip to content

Commit 49571ff

Browse files
committed
csv-parser: fix use of uninitialized member silent
There were two instances of the flag by mistake. Detected by Coverity.
1 parent e3b5c76 commit 49571ff

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/csv-parser.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
struct AbstractCsvParser::Private {
2727
const std::string *pFileName = nullptr;
2828
int lineno = 0;
29-
bool silent = false;
3029
bool hasError = false;
3130
};
3231

@@ -70,7 +69,7 @@ void AbstractCsvParser::parseError(const std::string &msg)
7069
{
7170
assert(d->pFileName);
7271
d->hasError = true;
73-
if (d->silent)
72+
if (this->silent)
7473
return;
7574

7675
std::cerr

src/csv-parser.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class AbstractCsvParser {
4141
virtual bool /* continue */ handleLine(const TStringList &) = 0;
4242
void parseError(const std::string &msg);
4343

44-
bool silent;
44+
bool silent = false;
4545

4646
private:
4747
struct Private;

0 commit comments

Comments
 (0)