X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=dump-spo2.c;h=06b3902e3efd22cea75daf343f9906c14892100d;hb=53fb600bd20576419781bbca4c3d3c6be420a599;hp=847dcac45c96ebb568ad515d3429edce9f2c018d;hpb=96c7d3dc94c2e3f2d587e42382b541c5ec70ec9a;p=pspp diff --git a/dump-spo2.c b/dump-spo2.c index 847dcac45c..06b3902e3e 100644 --- a/dump-spo2.c +++ b/dump-spo2.c @@ -307,7 +307,8 @@ get_string4(const char *where) /*data[pos + 1] == 0 && data[pos + 2] == 0 && data[pos + 3] == 0*/ /*&& all_ascii(&data[pos + 4], data[pos])*/) { - int len = data[pos] + data[pos + 1] * 256; + assert(data[pos + 3] == 0); + int len = data[pos] + data[pos + 1] * 256 + data[pos + 2] * 65536; char *s = malloc(len + 1); memcpy(s, &data[pos + 4], len); @@ -793,6 +794,7 @@ main(int argc, char *argv[]) match_u32_assert(132); match_zeros_assert(8); match_u32_assert(1); + printf ("0x%x\n", pos); get_string4(); match_byte_assert(0);