Hi all,

I found a bug in ccrtp-1.5.1 in the function:
 
timeval NTP2Timeval(uint32 msw, uint32 lsw)


--- ccrtp-1.5.1/src/rtcppkt.orig.cpp    2006-12-31 14:12:40.000000000 +0100
+++ ccrtp-1.5.1/src/rtcppkt.cpp 2007-10-28 18:54:49.000000000 +0100
@@ -61,7 +61,7 @@
 {
        struct timeval t;
        t.tv_sec = msw - NTP_EPOCH_OFFSET;
-       t.tv_usec = (uint32)(((double)lsw) * 1000000.0) / ((uint32)(~0));
+       t.tv_usec = (uint32)((((double)lsw) * 1000000.0) / ((uint32)(~0)));
        return t;
 }


A pair of brackets is missing. ((double)(lsw) * 1000000.0) is casted to 
uint32_t before dividing it by ((uint32)(~0)) instead of dividing it first 
and casting the result.
Microseconds in the struct timval are always 0 because of this.

regards
Martin Runge


_______________________________________________
Ccrtp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/ccrtp-devel

Reply via email to