Skip to content

Commit 159a57b

Browse files
authored
Merge pull request #12291 from DavidLin1577/patch-2
Minor optimisation to ATCmdParser unit test code
2 parents cb53825 + b49dac2 commit 159a57b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

UNITTESTS/platform/ATCmdParser/test_ATCmdParser.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ TEST_F(test_ATCmdParser, test_ATCmdParser_process_oob)
9797
filehandle_stub_short_value_counter = 2;
9898
at.process_oob();
9999

100-
char buf[5];
100+
char buf[5] = {0};
101101
char table[] = "ssssssssssssssssssssssssssssssss\0";
102102
filehandle_stub_table = table;
103103
filehandle_stub_table_pos = 0;
@@ -189,8 +189,8 @@ TEST_F(test_ATCmdParser, test_ATCmdParser_read)
189189
filehandle_stub_table_pos = 0;
190190

191191
ATCmdParser at(&fh1, ",");
192-
char buf[8];
193-
memset(buf, 0, 8);
192+
char buf[8] = {0};
193+
194194

195195
// TEST EMPTY BUFFER
196196
// Shouldn't read any byte since buffer is empty

0 commit comments

Comments
 (0)