projects
/
pspp-builds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0ee0a3f
)
dissect-sysfile: Properly interpret padding bytes in compressed data.
author
Ben Pfaff
<blp@cs.stanford.edu>
Sat, 22 May 2010 18:24:48 +0000
(11:24 -0700)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Sat, 22 May 2010 18:24:48 +0000
(11:24 -0700)
tests/dissect-sysfile.c
patch
|
blob
|
history
diff --git
a/tests/dissect-sysfile.c
b/tests/dissect-sysfile.c
index 3d26a0fb0275c448faa728d529c8ed72022dbd92..4fc610a9972ba72a27fed40976d53958182ae65f 100644
(file)
--- a/
tests/dissect-sysfile.c
+++ b/
tests/dissect-sysfile.c
@@
-1084,7
+1084,7
@@
read_compressed_data (struct sfm_reader *r)
{
printf ("%08llx: case %d's uncompressible data begins\n",
(long long int) ftello (r->file), case_num);
{
printf ("%08llx: case %d's uncompressible data begins\n",
(long long int) ftello (r->file), case_num);
- for (i = 0; i < r->n_var_widths;
i++
)
+ for (i = 0; i < r->n_var_widths; )
{
int width = r->var_widths[i];
char raw_value[8];
{
int width = r->var_widths[i];
char raw_value[8];
@@
-1107,6
+1107,11
@@
read_compressed_data (struct sfm_reader *r)
if (width != 0)
printf (", but this is a string variable (width=%d)", width);
printf ("\n");
if (width != 0)
printf (", but this is a string variable (width=%d)", width);
printf ("\n");
+ i++;
+ break;
+
+ case 0:
+ printf ("ignored padding\n");
break;
case 252:
break;
case 252:
@@
-1118,6
+1123,7
@@
read_compressed_data (struct sfm_reader *r)
printf ("uncompressible data: ");
print_untyped_value (r, raw_value);
printf ("\n");
printf ("uncompressible data: ");
print_untyped_value (r, raw_value);
printf ("\n");
+ i++;
break;
case 254:
break;
case 254:
@@
-1125,14
+1131,15
@@
read_compressed_data (struct sfm_reader *r)
if (width == 0)
printf (", but this is a numeric variable");
printf ("\n");
if (width == 0)
printf (", but this is a numeric variable");
printf ("\n");
+ i++;
break;
case 255:
printf ("SYSMIS");
if (width != 0)
printf (", but this is a string variable (width=%d)", width);
break;
case 255:
printf ("SYSMIS");
if (width != 0)
printf (", but this is a string variable (width=%d)", width);
-
printf ("\n");
printf ("\n");
+ i++;
break;
}
break;
}