More static analysis fixes
This commit is contained in:
parent
cafd868773
commit
0da3390d09
14 changed files with 40 additions and 33 deletions
|
@ -56,8 +56,8 @@ void xmrig::LineReader::reset()
|
|||
|
||||
void xmrig::LineReader::add(const char *data, size_t size)
|
||||
{
|
||||
if (size > XMRIG_NET_BUFFER_CHUNK_SIZE - m_pos) {
|
||||
// it breakes correctness silently for long lines
|
||||
if (size + m_pos > XMRIG_NET_BUFFER_CHUNK_SIZE) {
|
||||
// it breaks correctness silently for long lines
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ std::vector<xmrig::String> xmrig::String::split(char sep) const
|
|||
|
||||
for (pos = 0; pos < m_size; ++pos) {
|
||||
if (m_data[pos] == sep) {
|
||||
if ((pos - start) > 0) {
|
||||
if (pos > start) {
|
||||
out.emplace_back(m_data + start, pos - start);
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ std::vector<xmrig::String> xmrig::String::split(char sep) const
|
|||
}
|
||||
}
|
||||
|
||||
if ((pos - start) > 0) {
|
||||
if (pos > start) {
|
||||
out.emplace_back(m_data + start, pos - start);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue