Skip to content
Permalink
Browse files Browse the repository at this point in the history
SOME/IP: Fix terminating a "struct tok" array
Moreover:
Declare static and const the "struct tok" arrays.
  • Loading branch information
fxlb committed Feb 29, 2020
1 parent cd0857c commit e2256b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions print-someip.c
Expand Up @@ -42,7 +42,7 @@
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/

struct tok message_type_values[] = {
static const struct tok message_type_values[] = {
{ 0x00, "REQUEST" },
{ 0x01, "REQUEST_NO_RETURN" },
{ 0x02, "NOTIFICATION" },
Expand All @@ -56,7 +56,7 @@ struct tok message_type_values[] = {
{ 0, NULL }
};

struct tok return_code_values[] = {
static const struct tok return_code_values[] = {
{ 0x00, "E_OK" },
{ 0x01, "E_NOT_OK" },
{ 0x02, "E_UNKNOWN_SERVICE" },
Expand All @@ -73,6 +73,7 @@ struct tok return_code_values[] = {
{ 0x0d, "E_E2E" },
{ 0x0e, "E_E2E_NOT_AVAILABLE" },
{ 0x0f, "E_E2E_NO_NEW_DATA" },
{ 0, NULL }
};

void
Expand Down

0 comments on commit e2256b4

Please sign in to comment.