Catch attempts to register ett_ values after the array of "tree is
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 18 Apr 2002 00:50:45 +0000 (00:50 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 18 Apr 2002 00:50:45 +0000 (00:50 +0000)
expanded" flags has been allocated.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5197 f5534014-38df-0310-8fa8-9805f1628bb7

epan/proto.c

index eb42540a8717947b07f431c58cccee5e4aa2e29d..e0d8d76281068ee5a6858cd083f78e80b209c4d2 100644 (file)
@@ -1,7 +1,7 @@
 /* proto.c
  * Routines for protocol tree
  *
- * $Id: proto.c,v 1.60 2002/04/04 20:23:50 guy Exp $
+ * $Id: proto.c,v 1.61 2002/04/18 00:50:45 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -2082,6 +2082,16 @@ proto_register_subtree_array(gint **indices, int num_indices)
        int     i;
        gint    **ptr = indices;
 
+       /*
+        * Make sure we haven't already allocated the array of "tree is
+        * expanded" flags.
+        *
+        * XXX - if it's *really* important to allow more ett_ values to
+        * be given out after "proto_init()" is called, we could expand
+        * the array.
+        */
+       g_assert(tree_is_expanded == NULL);
+
        /*
         * Assign "num_indices" subtree numbers starting at "num_tree_types",
         * returning the indices through the pointers in the array whose