diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-01-06 20:30:38 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-01-06 20:30:38 +0000 |
commit | db1246913ed17b0fb74b0b3b2efe4ce8fc683977 (patch) | |
tree | f23671365022c676c82e7a6982f2d9bcecaa10ea /wiretap | |
parent | 87b638a94fa9ebd48be15d6faae10675a3268699 (diff) |
Cast "secs" to "double" before multiplying by 1000000, so that we don't
get an overflow if secs*1000000 doesn't fit in 31 bits.
svn path=/trunk/; revision=6858
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/netmon.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/wiretap/netmon.c b/wiretap/netmon.c index f812151703..ba86b50902 100644 --- a/wiretap/netmon.c +++ b/wiretap/netmon.c @@ -1,6 +1,6 @@ /* netmon.c * - * $Id: netmon.c,v 1.62 2003/01/03 06:45:45 guy Exp $ + * $Id: netmon.c,v 1.63 2003/01/06 20:30:38 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> @@ -434,7 +434,7 @@ static gboolean netmon_read(wtap *wth, int *err, long *data_offset) break; } secs = (time_t)(t/1000000); - usecs = (guint32)(t - secs*1000000); + usecs = (guint32)(t - (double)secs*1000000); wth->phdr.ts.tv_sec = netmon->start_secs + secs; wth->phdr.ts.tv_usec = usecs; wth->phdr.caplen = packet_size; |