dump: Fix handling of one odd case.
[pspp] / dump.c
diff --git a/dump.c b/dump.c
index e758a5b71bacc6e1847fa5100e7eae88959a7c3b..3382f7a8b4203ee8f14a31d0410ac54ac5d2ed30 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -125,7 +125,7 @@ match_byte_assert(uint8_t b, const char *where)
 #define match_byte_assert(b) match_byte_assert(b, WHERE)
 
 static char *
-get_string(void)
+get_string(const char *where)
 {
   if (data[pos + 1] == 0 && data[pos + 2] == 0 && data[pos + 3] == 0
       /*&& all_ascii(&data[pos + 4], data[pos])*/)
@@ -140,10 +140,11 @@ get_string(void)
     }
   else
     {
-      fprintf(stderr, "0x%x: expected string\n", pos);
+      fprintf(stderr, "%s: 0x%x: expected string\n", where, pos);
       exit(1);
     }
 }
+#define get_string() get_string(WHERE)
 
 static void
 dump_value(int level)
@@ -203,6 +204,9 @@ dump_value(int level)
       if (!match_u32 (3))
         match_u32_assert (2);
       match_byte (0);
+      match_byte (0);
+      match_byte (0);
+      match_byte (0);
     }
   else if (match_byte (4))
     {
@@ -384,6 +388,13 @@ dump_category(int level)
       match_byte (0);
       get_u32 ();
     }
+  else if (match_byte (1))
+    {
+      match_byte (0);
+      match_u32_assert (1);
+      match_byte (0);
+      get_u32();
+    }
   else
     {
       match_u32_assert (0);