optimize the code of array set to zero

1. replace  'char buf[8];    memset(buf, 0, 8);' with 'char buf[8] = {0};'.
pull/12291/head
David Lin 2020-01-21 20:23:55 +08:00 committed by GitHub
parent 80fe861f1d
commit b49dac2de0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -97,7 +97,7 @@ TEST_F(test_ATCmdParser, test_ATCmdParser_process_oob)
filehandle_stub_short_value_counter = 2;
at.process_oob();
char buf[5];
char buf[5] = {0};
char table[] = "ssssssssssssssssssssssssssssssss\0";
filehandle_stub_table = table;
filehandle_stub_table_pos = 0;
@ -189,8 +189,8 @@ TEST_F(test_ATCmdParser, test_ATCmdParser_read)
filehandle_stub_table_pos = 0;
ATCmdParser at(&fh1, ",");
char buf[8];
memset(buf, 0, 8);
char buf[8] = {0};
// TEST EMPTY BUFFER
// Shouldn't read any byte since buffer is empty