Mercurial > pidgin
changeset 21944:c2c66ffcdfa7
Prevent a divide by zero. Fixes #4490.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 27 Dec 2007 16:29:58 +0000 |
parents | 0981db925997 |
children | 3fc5862b834a |
files | pidgin/gtkft.c |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkft.c Wed Dec 26 02:49:24 2007 +0000 +++ b/pidgin/gtkft.c Thu Dec 27 16:29:58 2007 +0000 @@ -156,15 +156,15 @@ } if (time_remaining != NULL) { - if (purple_xfer_get_size(xfer) == 0) { - *time_remaining = g_strdup(_("Unknown")); - } - else if (purple_xfer_is_completed(xfer)) { + if (purple_xfer_is_completed(xfer)) { *time_remaining = g_strdup(_("Finished")); } else if (purple_xfer_is_canceled(xfer)) { *time_remaining = g_strdup(_("Canceled")); } + else if (purple_xfer_get_size(xfer) == 0 || (kb_sent > 0 && kbps == 0)) { + *time_remaining = g_strdup(_("Unknown")); + } else if (kb_sent <= 0) { *time_remaining = g_strdup(_("Waiting for transfer to begin")); }