Changeset 1552 for zzuf


Ignore:
Timestamp:
Jan 3, 2007, 11:25:45 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Do not fuzz anything if 0 bytes were read.
  • Added a debug message for fuzzing.
Location:
zzuf/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/fuzz.c

    r1527 r1552  
    4343    unsigned int i, j, todo;
    4444
     45    debug("fuzz(%i, %lli@%li)", fd, (unsigned long long int)len,
     46          (unsigned long int)pos);
     47
    4548    fuzz = _zz_getfuzz(fd);
    46 
    4749    aligned_buf = buf - pos;
    4850
  • zzuf/trunk/src/load-stream.c

    r1551 r1552  
    168168         * a partial read may have advanced the stream pointer */
    169169        long int newpos = ftell(stream);
    170         _zz_fuzz(fd, ptr, newpos - pos);
    171         _zz_setpos(fd, newpos);
     170        if(newpos != pos)
     171        {
     172            _zz_fuzz(fd, ptr, newpos - pos);
     173            _zz_setpos(fd, newpos);
     174        }
    172175    }
    173176    return ret;
Note: See TracChangeset for help on using the changeset viewer.