From 23c477142ee3c7bbe18808248e9e88f8328a2334 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 5 Jan 2012 21:11:55 +0000 Subject: [PATCH] merged integer overflow fix from aio branch --- src/session_impl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/session_impl.cpp b/src/session_impl.cpp index cf2dde230..896af0bff 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -3487,8 +3487,10 @@ namespace aux { #define STAT_LOG(type, val) fprintf(m_stats_logger, "%" #type "\t", val) STAT_LOG(f, total_milliseconds(now - m_last_log_rotation) / 1000.f); - STAT_LOG(d, int(m_stat.total_upload() - m_last_uploaded)); - STAT_LOG(d, int(m_stat.total_download() - m_last_downloaded)); + size_type uploaded = m_stat.total_upload() - m_last_uploaded; + STAT_LOG(d, int(uploaded)); + size_type downloaded = m_stat.total_download() - m_last_downloaded; + STAT_LOG(d, int(downloaded)); STAT_LOG(d, downloading_torrents); STAT_LOG(d, seeding_torrents); STAT_LOG(d, num_complete_connections);