Changeset 2332
- Timestamp:
- May 18, 2008, 11:45:48 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/src/lib-stream.c
r2331 r2332 370 370 371 371 #if defined HAVE___SREFILL /* Don't fuzz or seek if we have __srefill() */ 372 # define FGETS_FUZZ \372 # define FGETS_FUZZ(fn, fn2) \ 373 373 _zz_lock(fd); \ 374 ret = ORIG(f gets)(s, size, stream); \374 ret = ORIG(fn)(s, size, stream); \ 375 375 _zz_unlock(fd); 376 376 #else 377 # define FGETS_FUZZ \377 # define FGETS_FUZZ(fn, fn2) \ 378 378 if(size <= 0) \ 379 379 ret = NULL; \ … … 387 387 int ch; \ 388 388 _zz_lock(fd); \ 389 ch = ORIG(f getc)(stream); \389 ch = ORIG(fn2)(stream); \ 390 390 _zz_unlock(fd); \ 391 391 if(ch == EOF) \ … … 408 408 #endif 409 409 410 #define FGETS(fn ) \410 #define FGETS(fn, fn2) \ 411 411 do \ 412 412 { \ … … 414 414 ret = s; \ 415 415 LOADSYM(fn); \ 416 LOADSYM(f getc); \416 LOADSYM(fn2); \ 417 417 fd = fileno(stream); \ 418 418 if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd)) \ 419 419 return ORIG(fn)(s, size, stream); \ 420 FGETS_FUZZ \420 FGETS_FUZZ(fn, fn2) \ 421 421 debug("%s(%p, %i, [%i]) = %p", __func__, s, size, fd, ret); \ 422 422 } while(0) … … 424 424 char *NEW(fgets)(char *s, int size, FILE *stream) 425 425 { 426 char *ret; FGETS(fgets ); return ret;426 char *ret; FGETS(fgets, fgetc); return ret; 427 427 } 428 428 … … 430 430 char *NEW(fgets_unlocked)(char *s, int size, FILE *stream) 431 431 { 432 char *ret; FGETS(fgets_unlocked ); return ret;432 char *ret; FGETS(fgets_unlocked, fgetc_unlocked); return ret; 433 433 } 434 434 #endif
Note: See TracChangeset
for help on using the changeset viewer.