summaryrefslogtreecommitdiff
path: root/recordmydesktop
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-11-28 23:02:02 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-11-28 23:02:02 +0000
commitfd4c3b1253ba5815e59ea1870253247dceb15ea3 (patch)
tree6144339b7d001d52d8ce76593732bb370412447c /recordmydesktop
parentc1e4fe840b303d3ac0670bf4038e74bfd6fa818d (diff)
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
Diffstat (limited to 'recordmydesktop')
-rw-r--r--recordmydesktop/src/cache_frame.c17
1 files changed, 9 insertions, 8 deletions
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);
© All Rights Reserved