Skip to content

Commit e2256b4

Browse files
committed
SOME/IP: Fix terminating a "struct tok" array
Moreover: Declare static and const the "struct tok" arrays.
1 parent cd0857c commit e2256b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: print-someip.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
4343
*/
4444

45-
struct tok message_type_values[] = {
45+
static const struct tok message_type_values[] = {
4646
{ 0x00, "REQUEST" },
4747
{ 0x01, "REQUEST_NO_RETURN" },
4848
{ 0x02, "NOTIFICATION" },
@@ -56,7 +56,7 @@ struct tok message_type_values[] = {
5656
{ 0, NULL }
5757
};
5858

59-
struct tok return_code_values[] = {
59+
static const struct tok return_code_values[] = {
6060
{ 0x00, "E_OK" },
6161
{ 0x01, "E_NOT_OK" },
6262
{ 0x02, "E_UNKNOWN_SERVICE" },
@@ -73,6 +73,7 @@ struct tok return_code_values[] = {
7373
{ 0x0d, "E_E2E" },
7474
{ 0x0e, "E_E2E_NOT_AVAILABLE" },
7575
{ 0x0f, "E_E2E_NO_NEW_DATA" },
76+
{ 0, NULL }
7677
};
7778

7879
void

0 commit comments

Comments
 (0)