diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2004-02-23 20:22:57 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2004-02-23 20:22:57 +0000 |
commit | 06966bed79187136ddcf6b10b59f50d3ba948700 (patch) | |
tree | af451b3bc86bf005037993948ba53287e31c2a58 /ztmonitor.c | |
parent | d3aba38b829108c5315aee7be7e8f243d3050d3e (diff) |
Prevent integer overflow on timeout
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@316 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'ztmonitor.c')
-rwxr-xr-x | ztmonitor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ztmonitor.c b/ztmonitor.c index 642ce2a..a579146 100755 --- a/ztmonitor.c +++ b/ztmonitor.c @@ -194,12 +194,12 @@ void visualize(short *tx, short *rx, int cnt) static int samerxmax = 0; static int txbest = 0; static int rxbest = 0; - int ms; + float ms; static struct timeval last; struct timeval tv; gettimeofday(&tv, NULL); - ms = (tv.tv_sec - last.tv_sec) * 1000 + (tv.tv_usec - last.tv_usec) / 1000; + ms = (tv.tv_sec - last.tv_sec) * 1000.0 + (tv.tv_usec - last.tv_usec) / 1000.0; for (x=0;x<cnt;x++) { txavg += abs(tx[x]); rxavg += abs(rx[x]); |