Skip to content

Commit fb01ad9

Browse files
committed
Minor change to satisfy cppcheck
1 parent f037bd2 commit fb01ad9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/regex.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Regex::~Regex() {
112112

113113
std::list<SMatch> Regex::searchAll(const std::string& s) const {
114114
std::list<SMatch> retList;
115-
int rc;
115+
int rc = 0;
116116
#ifdef WITH_PCRE2
117117
PCRE2_SPTR pcre2_s = reinterpret_cast<PCRE2_SPTR>(s.c_str());
118118
PCRE2_SIZE offset = 0;
@@ -167,7 +167,7 @@ bool Regex::searchOneMatch(const std::string& s, std::vector<SMatchCapture>& cap
167167
#ifdef WITH_PCRE2
168168
PCRE2_SPTR pcre2_s = reinterpret_cast<PCRE2_SPTR>(s.c_str());
169169
pcre2_match_data *match_data = pcre2_match_data_create_from_pattern(m_pc, NULL);
170-
int rc;
170+
int rc = 0;
171171
if (m_pcje == 0) {
172172
rc = pcre2_jit_match(m_pc, pcre2_s, s.length(), 0, 0, match_data, NULL);
173173
}
@@ -285,7 +285,7 @@ int Regex::search(const std::string& s, SMatch *match) const {
285285
#ifdef WITH_PCRE2
286286
PCRE2_SPTR pcre2_s = reinterpret_cast<PCRE2_SPTR>(s.c_str());
287287
pcre2_match_data *match_data = pcre2_match_data_create_from_pattern(m_pc, NULL);
288-
int ret;
288+
int ret = 0;
289289
if (m_pcje == 0) {
290290
ret = pcre2_match(m_pc, pcre2_s, s.length(),
291291
0, 0, match_data, NULL) > 0;
@@ -319,7 +319,7 @@ int Regex::search(const std::string& s) const {
319319
#ifdef WITH_PCRE2
320320
PCRE2_SPTR pcre2_s = reinterpret_cast<PCRE2_SPTR>(s.c_str());
321321
pcre2_match_data *match_data = pcre2_match_data_create_from_pattern(m_pc, NULL);
322-
int rc;
322+
int rc = 0;
323323
if (m_pcje == 0) {
324324
rc = pcre2_jit_match(m_pc, pcre2_s, s.length(), 0, 0, match_data, NULL);
325325
}

0 commit comments

Comments
 (0)