Skip to content

Commit

Permalink
Fixed cppcheck errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SChernykh committed Dec 1, 2024
1 parent 8071ff9 commit 94da2e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/stratum_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ StratumServer::StratumClient::StratumClient()
, m_lastJobTarget(0)
, m_score(0)
{
m_rawReadBuf[0] = '\0';
m_stratumReadBuf[0] = '\0';
}

Expand Down Expand Up @@ -1197,7 +1198,8 @@ bool StratumServer::StratumClient::on_read(const char* data, uint32_t size)
m_stratumReadBufBytes += size;

char* line_start = m_stratumReadBuf;
for (char *e = line_start + m_stratumReadBufBytes, *c = e - size; c < e; ++c) {
const char* e = line_start + m_stratumReadBufBytes;
for (char *c = line_start + m_stratumReadBufBytes - size; c < e; ++c) {
if (*c == '\n') {
// Check if the line starts with "GET " or "HEAD" (an HTTP request)
if (c - line_start >= 4) {
Expand Down

0 comments on commit 94da2e8

Please sign in to comment.