Ignore:
Timestamp:
Nov 26, 2009, 2:14:05 AM (6 years ago)
Author:
sam
Message:

Reset offset position before most stdio call.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/lib-stream.c

    r4041 r4042  
    527527        DEBUG_STREAM("old", stream); \
    528528        oldpos = MYFTELL(stream); \
     529        _zz_setpos(fd, oldpos); \
    529530        _zz_lock(fd); \
    530531        ret = ORIG(myfread)(ptr, size, nmemb, stream); \
     
    580581            return ORIG(myfgetc)(arg); \
    581582        DEBUG_STREAM("old", s); \
     583        _zz_setpos(fd, MYFTELL(s)); \
    582584        _zz_lock(fd); \
    583585        ret = ORIG(myfgetc)(arg); \
     
    694696            return ORIG(myfgets)(s, size, stream); \
    695697        DEBUG_STREAM("old", s); \
     698        _zz_setpos(fd, MYFTELL(stream)); \
    696699        FGETS_FUZZ(myfgets, myfgetc) \
    697700        debug("%s(%p, %i, [%i]) = %p", __func__, s, size, fd, ret); \
     
    725728
    726729    DEBUG_STREAM("old", stream);
     730    _zz_setpos(fd, MYFTELL(stream));
    727731    _zz_lock(fd);
    728732    ret = ORIG(ungetc)(c, stream);
     
    791795        } \
    792796        DEBUG_STREAM("old", stream); \
     797        _zz_setpos(fd, MYFTELL(stream)); \
    793798        line = *lineptr; \
    794799        size = line ? *n : 0; \
     
    885890    _zz_unlock(fd);
    886891#else
     892    _zz_setpos(fd, MYFTELL(stream));
    887893    fuzz = _zz_getfuzz(fd);
    888894
Note: See TracChangeset for help on using the changeset viewer.