Changeset 1040


Ignore:
Timestamp:
Jul 6, 2008, 1:21:38 AM (17 years ago)
Author:
Gregg Young
Message:

Fixed last 2 (at least that I could find) hard coded command line lengths (ticket 233)

Location:
trunk/dll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r1039 r1040  
    15641564        case IDM_DELETE:
    15651565          {
    1566             CHAR cl[1001], *endofit;
     1566            CHAR *endofit;
     1567            PSZ pszCmdLine;
    15671568            INT z;
    15681569            CHECKLIST ck;
     
    15901591            li->list = ck.list;
    15911592            if (!li->list || !li->list[0])
    1592               break;
    1593             strcpy(cl, li->type == IDM_DELETE ?
     1593              break;
     1594            pszCmdLine = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
     1595            if (!pszCmdLine)
     1596              break;
     1597            strcpy(pszCmdLine, li->type == IDM_DELETE ?
    15941598                         dcd->info->delete :
    15951599                         dcd->info->create);
    1596             strcat(cl, " ");
    1597             BldQuotedFileName(cl + strlen(cl), dcd->arcname);
    1598             endofit = &cl[strlen(cl)];
     1600            strcat(pszCmdLine, " ");
     1601            BldQuotedFileName(pszCmdLine + strlen(pszCmdLine), dcd->arcname);
     1602            endofit = &pszCmdLine[strlen(pszCmdLine)];
    15991603            z = 0;
    16001604            do {
    16011605              for (x = z; li->list[x] &&
    1602                 strlen(cl) + strlen(li->list[x]) < 999; x++) {
    1603                 strcat(cl, " ");
    1604                 BldQuotedFileName(cl + strlen(cl), li->list[x]);
     1606                strlen(pszCmdLine) + strlen(li->list[x]) < 999; x++) {
     1607                strcat(pszCmdLine, " ");
     1608                BldQuotedFileName(pszCmdLine + strlen(pszCmdLine), li->list[x]);
    16051609              }
    16061610              z = x;
    16071611              runemf2(SEPARATE | WINDOWED | WAIT |
    16081612                      (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED),
    1609                       hwnd, pszSrcFile, __LINE__, NullStr, NULL, "%s", cl);
    1610               *endofit = 0;
     1613                      hwnd, pszSrcFile, __LINE__, NullStr, NULL, "%s", pszCmdLine);
     1614              *endofit = 0;
     1615              free(pszCmdLine);
    16111616            } while (li->list[x]);
    16121617            PostMsg(dcd->hwndCnr, UM_RESCAN, MPFROMSHORT(1), MPVOID);
     
    16311636        case IDM_EXTRACT:
    16321637          {
    1633             CHAR cl[1001], *endofit, *ptr;
     1638            CHAR *endofit, *ptr;
     1639            PSZ pszCmdLine;
    16341640            INT z;
    16351641
     
    16911697            }
    16921698            if (!li->list || !li->list[0])
    1693               break;
    1694             strcpy(cl,
     1699              break;
     1700            pszCmdLine = xmallocz(MaxComLineStrg, pszSrcFile, __LINE__);
     1701            if (!pszCmdLine)
     1702              break;
     1703            strcpy(pszCmdLine,
    16951704                   (li->type == IDM_EXTRACT ||
    16961705                    ((li->type == IDM_VIEW ||
     
    17061715                     li->info->extract :
    17071716                     li->info->exwdirs);
    1708              strcat(cl, " ");
    1709              BldQuotedFileName(cl + strlen(cl), li->arcname);
    1710              endofit = &cl[strlen(cl)];
     1717             strcat(pszCmdLine, " ");
     1718             BldQuotedFileName(pszCmdLine + strlen(pszCmdLine), li->arcname);
     1719             endofit = &pszCmdLine[strlen(pszCmdLine)];
    17111720             z = 0;
    17121721             do {
    17131722               for (x = z; li->list[x] &&
    1714                    strlen(cl) + strlen(li->list[x]) < 999; x++) {
    1715                 strcat(cl, " ");
    1716                 BldQuotedFileName(cl + strlen(cl), li->list[x]);
     1723                   strlen(pszCmdLine) + strlen(li->list[x]) < 999; x++) {
     1724                strcat(pszCmdLine, " ");
     1725                BldQuotedFileName(pszCmdLine + strlen(pszCmdLine), li->list[x]);
    17171726                ptr = li->list[x];
    17181727                while (*ptr) {
     
    17261735                      (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED) |
    17271736                      WAIT, hwnd, pszSrcFile, __LINE__,
    1728                       li->targetpath, NULL, "%s", cl);
     1737                      li->targetpath, NULL, "%s", pszCmdLine);
    17291738              *endofit = 0;
    17301739            } while (li->list[x]);
     
    18131822                  }
    18141823                }
    1815                 BldFullPathName(cl, li->targetpath, li->list[x]);
     1824                BldFullPathName(pszCmdLine, li->targetpath, li->list[x]);
    18161825                temp = li->list[x];
    1817                 li->list[x] = xstrdup(cl, pszSrcFile, __LINE__);
     1826                li->list[x] = xstrdup(pszCmdLine, pszSrcFile, __LINE__);
     1827                free(pszCmdLine);
    18181828                if (!li->list[x])
    18191829                  li->list[x] = temp;
  • trunk/dll/mle.c

    r1039 r1040  
    813813      PostMsg(bkg->hwndReport, bkg->msg, MPVOID, MPVOID);
    814814      free(bkg);
     815      bkg = NULL;
    815816# ifdef FORTIFY
    816817  Fortify_LeaveScope();
Note: See TracChangeset for help on using the changeset viewer.