Skip to content

Commit

Permalink
last fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
egecetin committed Dec 8, 2024
1 parent 97a9b11 commit e5a3d3f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/telnet/TelnetServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,8 @@ void TelnetSession::update()

// we've got to be careful here. Telnet client might send null characters for New Lines mid-data block. We need
// to swap these out. recv is not null terminated, so its cool
std::replace_if(recvbuf.begin(), recvbuf.begin() + readBytes, [](char c) { return c == ASCII_NULL; }, ASCII_LF);
std::replace_if(
recvbuf.begin(), recvbuf.begin() + readBytes, [](char chr) { return chr == ASCII_NULL; }, ASCII_LF);

// Add it to the received buffer
m_buffer.append(recvbuf.data(), static_cast<unsigned int>(readBytes));
Expand Down
15 changes: 9 additions & 6 deletions src/utils/ConfigParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@

#include <fstream>

template <typename T> static std::string stringifyRapidjson(const T &obj)
namespace
{
rapidjson::StringBuffer sbuffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(sbuffer);
obj.Accept(writer);
return sbuffer.GetString();
}
template <typename T> std::string stringifyRapidjson(const T &obj)
{
rapidjson::StringBuffer sbuffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(sbuffer);
obj.Accept(writer);
return sbuffer.GetString();
}
} // namespace

void ConfigParser::readJson()
{
Expand Down

0 comments on commit e5a3d3f

Please sign in to comment.