]> The Tcpdump Group git mirrors - tcpdump/commitdiff
SOME/IP: Fix terminating a "struct tok" array
authorFrancois-Xavier Le Bail <[email protected]>
Sat, 29 Feb 2020 14:52:39 +0000 (15:52 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Sat, 29 Feb 2020 15:21:12 +0000 (16:21 +0100)
Moreover:
Declare static and const the "struct tok" arrays.

print-someip.c

index 3f3fcfc67e143a2c39240eaa5d6a3412bf95434b..bd6a74f39cb441e3a630fcdcefc28cf71706df57 100644 (file)
@@ -42,7 +42,7 @@
  *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  */
 
-struct tok message_type_values[] = {
+static const struct tok message_type_values[] = {
     { 0x00, "REQUEST" },
     { 0x01, "REQUEST_NO_RETURN" },
     { 0x02, "NOTIFICATION" },
@@ -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" },
@@ -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