commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r8626 - usrp2/trunk/host-ng/lib


From: eb
Subject: [Commit-gnuradio] r8626 - usrp2/trunk/host-ng/lib
Date: Thu, 19 Jun 2008 14:28:51 -0600 (MDT)

Author: eb
Date: 2008-06-19 14:28:51 -0600 (Thu, 19 Jun 2008)
New Revision: 8626

Modified:
   usrp2/trunk/host-ng/lib/usrp2_impl.cc
Log:
avoid divide by zero

Modified: usrp2/trunk/host-ng/lib/usrp2_impl.cc
===================================================================
--- usrp2/trunk/host-ng/lib/usrp2_impl.cc       2008-06-19 15:08:23 UTC (rev 
8625)
+++ usrp2/trunk/host-ng/lib/usrp2_impl.cc       2008-06-19 20:28:51 UTC (rev 
8626)
@@ -108,7 +108,7 @@
     if (USRP2_IMPL_DEBUG) {
       std::cerr << "usrp2 destructor: received " << d_num_rx_frames 
                << " frames, with " << d_num_rx_lost << " lost ("
-               << (int)(100.0*d_num_rx_lost/d_num_rx_frames)
+               << (d_num_rx_frames == 0 ? 0 : 
(int)(100.0*d_num_rx_lost/d_num_rx_frames))
                << "%), totaling " << d_num_rx_bytes
                << " bytes" << std::endl;
     }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]