From: Ben Pfaff Date: Fri, 31 Oct 2014 04:04:53 +0000 (-0700) Subject: dump: Fix handling of one odd case. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82ef136c39971399f44044c2f2874ec14bcc16eb;p=pspp dump: Fix handling of one odd case. --- diff --git a/dump.c b/dump.c index e758a5b71b..3382f7a8b4 100644 --- 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); diff --git a/notes b/notes index b5267e5a83..bfb1761dfc 100644 --- a/notes +++ b/notes @@ -886,6 +886,24 @@ i3 05 58 "Gender_R" 00 00 00 00 i2 i2 i1 00 00 00 00 00 00 00 00 ... +web/76e9b53e9f775fb690a88919ccdbb03c/00000000703_lightTableData.bin (oneway descriptives): + + i4 + + 05 58 "Gender_R" 00 00 00 00 02 00 00 i2 00 00 i1 00 i2 + 02 58 F40.0(0) "Gender_R" "Male" i2 i2 00 00 00 00 00 00 00 00 + 02 58 F40.0(1) "Gender_R" "Female" i2 i2 i1 00 00 00 00 + + 03 "Groups" 58 "groups" "Groups" 01 00 00 i2 01 00 01 i1 i2 + 05 58 "sexorient_r" "" 02 01 00 i1 00 i-1 i3 + 02 58 F40.0(0) "sexorient_r" "Straight" i2 i2 i0 i0 + 02 58 F40.0(1) "sexorient_r" "Bisexual" i2 i2 i1 i0 + 02 58 F40.0(2) "sexorient_r" "Gay/Lesbian/Homosexual" i2 i2 i2 00 00 00 00 + 03 "Total" 58 "total_4" "Total" i1 i2 i3 00 00 00 00 + + .... + + Data: tdump21 (germano/Crosstabs.pdf) -------------