aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_classify.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ndpi_classify.c')
-rw-r--r--src/lib/ndpi_classify.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/ndpi_classify.c b/src/lib/ndpi_classify.c
index e94bf2872..5c4fb2119 100644
--- a/src/lib/ndpi_classify.c
+++ b/src/lib/ndpi_classify.c
@@ -662,8 +662,9 @@ ndpi_timer_clear(pkt_timeval *a)
u_int64_t
ndpi_timeval_to_milliseconds(pkt_timeval ts)
{
- u_int64_t result = ts.tv_usec / 1000 + ts.tv_sec * 1000;
- return result;
+ u_int64_t sec = ts.tv_sec;
+ u_int64_t usec = ts.tv_usec;
+ return usec / 1000 + sec * 1000;
}
/**
@@ -674,8 +675,9 @@ ndpi_timeval_to_milliseconds(pkt_timeval ts)
u_int64_t
ndpi_timeval_to_microseconds(pkt_timeval ts)
{
- u_int64_t result = ts.tv_usec + ts.tv_sec * 1000 * 1000;
- return result;
+ u_int64_t sec = ts.tv_sec;
+ u_int64_t usec = ts.tv_usec;
+ return usec + sec * 1000 * 1000;;
}
void