* Better debug messages for special cases (eg. fgetc returning -1).

This commit is contained in:
Sam Hocevar 2007-01-28 00:21:58 +00:00 committed by sam
parent 2ebb906a12
commit 32ab6e10e2

View File

@ -300,7 +300,10 @@ size_t NEW(fread)(void *ptr, size_t size, size_t nmemb, FILE *stream)
ret = ORIG(fn)(stream); \
_zz_unlock(fd); \
FGETC_FUZZ \
debug("%s([%i]) = '%c'", __func__, fd, ret); \
if(ret < 0)
debug("%s([%i]) = %i", __func__, fd, ret); \
else
debug("%s([%i]) = '%c'", __func__, fd, ret); \
} while(0)
#undef getc /* can be a macro; we dont want that */
@ -401,7 +404,11 @@ int NEW(ungetc)(int c, FILE *stream)
#endif
}
debug("%s(0x%02x, [%i]) = '%c'", __func__, c, fd, ret);
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;
}