Commit 163aa355 authored by Francis Dupont's avatar Francis Dupont
Browse files

[5004] Addressed comments

parent 679c5a77
......@@ -151,8 +151,8 @@ CommandMgr::commandReader(int sockfd) {
try {
// Try to interpret it as JSON.
std::string sbuf(buf, static_cast<size_t>(rval));
cmd = Element::fromJSON(sbuf, true);
std::string sbuf(buf, static_cast<size_t>(rval));
cmd = Element::fromJSON(sbuf, true);
// If successful, then process it as a command.
rsp = CommandMgr::instance().processCommand(cmd);
......
......@@ -294,10 +294,10 @@ public:
OpaqueDataTuple::LengthFieldType len = (u == Option::V4?OpaqueDataTuple::LENGTH_1_BYTE:
OpaqueDataTuple::LENGTH_2_BYTES);
const char* content[] = { "alpha", "beta", "delta", "gamma", "epsilon",
"zeta", "eta", "theta", "iota", "kappa" };
size_t nb_content = sizeof(content) / sizeof(char*);
"zeta", "eta", "theta", "iota", "kappa" };
const size_t nb_content = sizeof(content) / sizeof(char*);
ASSERT_TRUE(tuples_size < nb_content);
for (unsigned i = 0; i < tuples_size; ++i) {
for (size_t i = 0; i < tuples_size; ++i) {
OpaqueDataTuple tuple(len);
tuple.assign(string(content[i]));
if (u == Option::V4 && i == 0) {
......
......@@ -532,7 +532,7 @@ ForwardTest::checkPushAndPop(int family, int type, int protocol,
// reliable. Instead we impose some reasonably large upper time limit of
// blocking (normally it shouldn't even block at all; the limit is to
// force the test to stop even if there's some bug and recv fails).
char recvbuf[sizeof(TEST_DATA) + 1];
char recvbuf[sizeof(TEST_DATA) + 1] = { };
sockaddr_storage ss;
socklen_t sa_len = sizeof(ss);
if (protocol == IPPROTO_UDP) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment