Changeset 44961cb


Ignore:
Timestamp:
2008-05-06T22:06:22Z (12 years ago)
Author:
ulim <a.sporto+bee@…>
Branches:
master
Children:
b043ad5
Parents:
d56ee38
Message:

fix bug in new kb/s display for transfers of less than one second.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/si.c

    rd56ee38 r44961cb  
    5555{
    5656        struct jabber_transfer *tf = ft->data;
    57         time_t diff = time( NULL ) - ft->started;
     57        time_t diff = time( NULL ) - ft->started ? : 1;
    5858
    5959        imcb_log( tf->ic, "File %s transferred successfully at %d kb/s!" , ft->file_name, (int) ( ft->bytes_transferred / 1024 / diff ) );
  • root_commands.c

    rd56ee38 r44961cb  
    10761076                        {
    10771077                                int kb_per_s = 0;
    1078                                 time_t diff = time( NULL ) - file->started;
     1078                                time_t diff = time( NULL ) - file->started ? : 1;
    10791079                                if ( ( file->started > 0 ) && ( file->bytes_transferred > 0 ) )
    10801080                                        kb_per_s = file->bytes_transferred / 1024 / diff;
Note: See TracChangeset for help on using the changeset viewer.