From fd4c3b1253ba5815e59ea1870253247dceb15ea3 Mon Sep 17 00:00:00 2001 From: iovar Date: Wed, 28 Nov 2007 23:02:02 +0000 Subject: Don't print compression stats when total_received_bytes=0 (avoid FPE) git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@439 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- recordmydesktop/src/cache_frame.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'recordmydesktop/src') diff --git a/recordmydesktop/src/cache_frame.c b/recordmydesktop/src/cache_frame.c index d4260e3..ae33bba 100644 --- a/recordmydesktop/src/cache_frame.c +++ b/recordmydesktop/src/cache_frame.c @@ -251,15 +251,16 @@ void *CacheImageBuffer(ProgData *pdata){ total_bytes+=(nbytes>>20); total_received_bytes=((frameno*((pdata->specs.depth>=24)?4:2)* pdata->brwin.rgeom.width*pdata->brwin.rgeom.height)>>20); - fprintf(stderr,"\n*********************************************\n" - "\nCached %d MB, from %d MB that were received.\n" - "Average cache compression ratio: %u %%\n" - "\n*********************************************\n", - total_bytes, - total_received_bytes, - (total_bytes*100)/total_received_bytes - ); + if(total_received_bytes){ + fprintf(stderr,"\n*********************************************\n" + "\nCached %d MB, from %d MB that were received.\n" + "Average cache compression ratio: %u %%\n" + "\n*********************************************\n", + total_bytes, + total_received_bytes, + (total_bytes*100)/total_received_bytes); + } fprintf(stderr,"Saved %d frames in a total of %d requests\n", frameno,frames_total);fflush(stderr); -- cgit v1.2.1