Changeset 9909


Ignore:
Timestamp:
Jan 10, 2010, 4:26:56 PM (12 years ago)
Author:
livings124
Message:

take a shot at #2715 - modular division on a negative number doesn't return a positive

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/session.c

    r9868 r9909  
    250250
    251251    if( toNextDay && (minutes < end) )
    252         day = (day - 1) % 7;
     252    {
     253        --day;
     254        if( day == -1 )
     255            day = 6;
     256    }
    253257
    254258    return ((1<<day) & s->altSpeedTimeDay) != 0;
     
    11491153            /* if looking at the end date, look at the next day if end time is before begin time */
    11501154            if( isEndTime && !isBeginTime && session->altSpeedTimeEnd < session->altSpeedTimeBegin )
    1151                 day = (day - 1) % 7;
     1155            {
     1156                --day;
     1157                if( day == -1 )
     1158                    day = 6;
     1159            }
    11521160
    11531161            isDay = ((1<<day) & session->altSpeedTimeDay) != 0;
Note: See TracChangeset for help on using the changeset viewer.