* Better debug messages for special cases (eg. fgetc returning -1).
This commit is contained in:
parent
2ebb906a12
commit
32ab6e10e2
@ -300,6 +300,9 @@ size_t NEW(fread)(void *ptr, size_t size, size_t nmemb, FILE *stream)
|
||||
ret = ORIG(fn)(stream); \
|
||||
_zz_unlock(fd); \
|
||||
FGETC_FUZZ \
|
||||
if(ret < 0)
|
||||
debug("%s([%i]) = %i", __func__, fd, ret); \
|
||||
else
|
||||
debug("%s([%i]) = '%c'", __func__, fd, ret); \
|
||||
} while(0)
|
||||
|
||||
@ -401,7 +404,11 @@ int NEW(ungetc)(int c, FILE *stream)
|
||||
#endif
|
||||
}
|
||||
|
||||
if(ret < 0)
|
||||
debug("%s(0x%02x, [%i]) = %i", __func__, c, fd, ret);
|
||||
else
|
||||
debug("%s(0x%02x, [%i]) = '%c'", __func__, c, fd, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user