Changeset 2558

Show
Ignore:
Timestamp:
07/17/08 01:17:07 (3 months ago)
Author:
sam
Message:
  • zzcat.c: partial fread() reads are undefined; avoid them in zzcat.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/test/zzcat.c

    r2532 r2558  
    102102            fseek(stream, myrand() % len, SEEK_SET); 
    103103            for(j = 0; j < 4; j++) 
    104                 fread(data + ftell(stream), myrand() % 4096, 1, stream); 
     104                fread(data + ftell(stream), 
     105                      myrand() % (len - ftell(stream)), 1, stream); 
    105106            fseek(stream, myrand() % len, SEEK_SET); 
    106107            now = ftell(stream);