From deee95ab68d4bc9df3bf59ce4bf5ac5fa1be46ec Mon Sep 17 00:00:00 2001 From: halleyscometsw Date: Wed, 31 Dec 2008 18:44:08 +0000 Subject: [PATCH] a more accurate streamfile error profiling git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@546 51a99a44-fe44-0410-b1ba-c3e57ba2b86b --- src/streamfile.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/streamfile.c b/src/streamfile.c index 469f0395..4370d98c 100644 --- a/src/streamfile.c +++ b/src/streamfile.c @@ -97,7 +97,14 @@ static size_t read_stdio(STDIOSTREAMFILE *streamfile,uint8_t * dest, off_t offse return length; } - return read_the_rest(dest,offset,length,streamfile); + { + size_t length_read = read_the_rest(dest,offset,length,streamfile); +#if PROFILE_STREAMFILE + if (length_read < length) + streamfile->error_count++; +#endif + return length_read; + } } static void close_stdio(STDIOSTREAMFILE * streamfile) {