Changeset 1562


Ignore:
Timestamp:
May 29, 2011, 7:45:54 PM (14 years ago)
Author:
Gregg Young
Message:

Code clean up for collector trap on find dups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/collect.c

    r1561 r1562  
    654654      RECORDINSERT ri;
    655655      ULONG ulMaxFiles;
    656       ULONGLONG ullTotalBytes;
     656      ULONGLONG ullTotalBytes, ullInitialTotalBytes;
    657657      CHAR fullname[CCHMAXPATH];
    658658      INT makeShort = 0;
     
    666666          WinSetWindowText(hwndStatus, (CHAR *) GetPString(IDS_COLLECTINGTEXT));
    667667      }
     668      ullInitialTotalBytes = dcd->ullTotalBytes;
    668669      while (li->list[y]) {
    669         for (ulMaxFiles = 0; li->list[ulMaxFiles + y] && ulMaxFiles < 65000; ulMaxFiles++) ;    // Count
     670        for (ulMaxFiles = 0; li->list[ulMaxFiles + y] && ulMaxFiles < USHRT_MAX; ulMaxFiles++) ;        // Count
    670671
    671672        if (ulMaxFiles) {
     
    687688              hdir = HDIR_CREATE;
    688689              DosError(FERR_DISABLEHARDERR);
    689               if (!makeShort &&
     690              if (ullInitialTotalBytes && !makeShort &&
    690691                  FindCnrRecord(dcd->hwndCnr, li->list[x], NULL, FALSE, FALSE, TRUE)) {
    691692                pci = UpdateCnrRecord(dcd->hwndCnr, li->list[x], FALSE, dcd);
     
    761762            }
    762763          }
     764        }
     765        if (makeShort > 1000) {
     766          Runtime_Error(pszSrcFile, __LINE__,
     767                        "You have exceeded 650,000,000 files which probably means either a momory alocation or a list creation failure. Either way contact us.");
     768          break;
    763769        }
    764770      } //While
Note: See TracChangeset for help on using the changeset viewer.