summaryrefslogtreecommitdiff
path: root/ztmonitor.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-02-23 20:22:57 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-02-23 20:22:57 +0000
commit06966bed79187136ddcf6b10b59f50d3ba948700 (patch)
treeaf451b3bc86bf005037993948ba53287e31c2a58 /ztmonitor.c
parentd3aba38b829108c5315aee7be7e8f243d3050d3e (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-xztmonitor.c4
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]);