From 548e0324ab5d7dc4093f4c5fffaaa45351142486 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 26 Nov 2007 20:27:07 +0000 Subject: [PATCH] fix stupid bug introduced in the last stats commit --- libtransmission/stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libtransmission/stats.c b/libtransmission/stats.c index f7a3c400d..25b8fc747 100644 --- a/libtransmission/stats.c +++ b/libtransmission/stats.c @@ -138,7 +138,7 @@ tr_getSessionStats( const tr_handle * handle, { const struct tr_stats_handle * stats = handle->sessionStats; *setme = stats->single; - setme->ratio = setme->uploadedBytes ? (double)setme->uploadedBytes / (double)setme->downloadedBytes : TR_RATIO_NA; + setme->ratio = setme->downloadedBytes ? (double)setme->uploadedBytes / (double)setme->downloadedBytes : TR_RATIO_NA; setme->secondsActive += ( time(NULL) - stats->startTime ); } @@ -148,7 +148,7 @@ tr_getCumulativeSessionStats( const tr_handle * handle, { const struct tr_stats_handle * stats = handle->sessionStats; *setme = stats->cumulative; - setme->ratio = setme->uploadedBytes ? (double)setme->uploadedBytes / (double)setme->downloadedBytes : TR_RATIO_NA; + setme->ratio = setme->downloadedBytes ? (double)setme->uploadedBytes / (double)setme->downloadedBytes : TR_RATIO_NA; setme->secondsActive += ( time(NULL) - stats->startTime ); }