Skip to content

Commit 3b51c89

Browse files
committed
these lines are things we want to allow
1 parent 298869e commit 3b51c89

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

code/parse/parselo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4004,7 +4004,7 @@ SCP_vector<std::pair<size_t, size_t>> str_wrap_to_width(const SCP_string& source
40044004
lines.emplace_back(pos_start, 0);
40054005
} else {
40064006
auto sublines = str_wrap_to_width(source_string, max_pixel_width, strip_leading_whitespace, pos_start, (newline_at - pos_start));
4007-
lines.reserve(lines.size() + sublines.size());
4007+
lines.reserve(lines.size() + sublines.size()); // coverity[inefficient_reserve:FALSE]
40084008
std::move(sublines.begin(), sublines.end(), std::back_inserter(lines));
40094009
}
40104010

@@ -4107,7 +4107,7 @@ SCP_vector<std::pair<size_t, size_t>> str_wrap_to_width(const char* source_strin
41074107
for (auto& subline : sublines)
41084108
subline.first += (ch_start - source_string);
41094109

4110-
lines.reserve(lines.size() + sublines.size());
4110+
lines.reserve(lines.size() + sublines.size()); // coverity[inefficient_reserve:FALSE]
41114111
std::move(sublines.begin(), sublines.end(), std::back_inserter(lines));
41124112
}
41134113

code/scripting/scripting.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ bool script_state::ParseCondition(const char *filename)
931931
bool found = false;
932932
pause_parse();
933933
SCP_vm_unique_ptr<char> parse{ vm_strdup(local_condition.c_str()) };
934-
reset_parse(parse.get());
934+
reset_parse(parse.get()); // coverity[escape:FALSE] - this is okay because the pointer escape only lasts until unpause_parse() restores the old state
935935
for (const auto& potential_condition : currHook->_conditions) {
936936
SCP_string bufCond;
937937
sprintf(bufCond, "$%s:", potential_condition.first.c_str());

0 commit comments

Comments
 (0)