Changeset 5572


Ignore:
Timestamp:
Apr 9, 2008, 6:40:13 PM (14 years ago)
Author:
livings124
Message:

(1.1x) a little extra safety when determining space needed to download

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1x/macosx/Torrent.m

    r5460 r5572  
    567567                                                        : [fileManager fileAttributesAtPath: path traverseLink: NO];
    568568                    if (fileAttributes)
    569                         neededSpace -= [[fileAttributes objectForKey: NSFileSize] unsignedLongLongValue];
     569                    {
     570                        unsigned long long fileSize = [[fileAttributes objectForKey: NSFileSize] unsignedLongLongValue];
     571                        if (fileSize < neededSpace)
     572                            neededSpace -= fileSize;
     573                        else
     574                            neededSpace = 0;
     575                    }
    570576                }
    571577            }
Note: See TracChangeset for help on using the changeset viewer.