From: Ben Pfaff Date: Fri, 7 Nov 2014 17:01:36 +0000 (-0800) Subject: Tie down category counting a bit better. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=10e7ab1aed2469e25494eab59b1a3f1cd32d42b9 Tie down category counting a bit better. --- diff --git a/dump.c b/dump.c index 3be7d5a9d6..63724092f3 100644 --- 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");