strncpy( fh.description, "Compressed Data File", TSL_DESCRSZ );
/* Process the squish statistics */
- fread( &d, sizeof(int), 1, sf );
+ if(fread( &d, sizeof(int), 1, sf ) < 1){
+ perror("Failed to read Window size from squish.stats");
+ exit(1);
+ }
printf( "Window size (bytes): %d\n", d );
univ_assign(fh.wsize, d);
- fread( &d, sizeof(int), 1, sf );
+ if(fread( &d, sizeof(int), 1, sf ) < 1){
+ perror("Failed to read Number of windows from squish.stats");
+ exit(1);
+ }
printf( "Number of windows: %d\n", d );
count = d;
univ_assign(fh.wnum, d);
winx = (Univ_Int *) w_table;
for (i=0; i <= count; i++) {
- fread( &d, sizeof(int), 1, sf );
+ if(fread( &d, sizeof(int), 1, sf ) < 1){
+ perror("Failed to read Window start point from squish.stats");
+ exit(1);
+ }
univ_assign(*winx++, j=d+headersize);
printf( "Window[%d] starts at %d\n", i, j );
}