Tie down category counting a bit better.
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 7 Nov 2014 17:01:36 +0000 (09:01 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 7 Nov 2014 17:01:36 +0000 (09:01 -0800)
dump.c

diff --git a/dump.c b/dump.c
index 3be7d5a9d6e94391b9adffb1d3cd062bdc4cac91..63724092f39075068567db4823b99388fb77755f 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -327,9 +327,13 @@ dump_category(int level)
   else if (!match_u32(2))
     match_u32_assert (0);
 
-  get_u32 ();
-
+  int indx = get_u32();
   int n_categories = get_u32();
+  if (indx != -1 && n_categories != 0)
+    {
+      fprintf(stderr, "index not -1 but subcategories\n");
+      exit(1);
+    }
   if (n_categories > 0)
     printf (", %d subcategories:", n_categories);
   printf("\n");