We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b566dec commit e51b7b0Copy full SHA for e51b7b0
test/src/common/big_endianTest.cpp
@@ -62,7 +62,7 @@ TEST(big_endian, bigEndianObject) {
62
63
char* newBuf = (char*)malloc(sizeof(char) * 8);
64
char* writeBuf = (char*)malloc(sizeof(char) * 8);
65
- strcpy(writeBuf, "RocketMQ");
+ strncpy(writeBuf, "RocketMQ", 8);
66
EXPECT_TRUE(writer.WriteBytes(writeBuf, (size_t)8));
67
EXPECT_TRUE(reader.ReadBytes(newBuf, (size_t)8));
68
EXPECT_EQ(*writeBuf, *newBuf);
@@ -76,7 +76,7 @@ TEST(big_endian, bigEndian) {
76
77
/*TODO
78
char *newBuf = (char *) malloc(sizeof(char) * 8);
79
- strcpy(newBuf, "RocketMQ");
+ strncpy(newBuf, "RocketMQ", 8);
80
81
char readBuf[8];
82
rocketmq::WriteBigEndian(writeBuf, newBuf);
0 commit comments