Changeset 918 for trunk/dll/command.c


Ignore:
Timestamp:
Jan 12, 2008, 9:16:37 PM (18 years ago)
Author:
Gregg Young
Message:

Fix CheckApp_QuoteAddExe to return a pointer on the stack instead of a string. Use MAXCOMLINESTRG for command line length.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/command.c

    r911 r918  
    4444typedef struct
    4545{
    46   CHAR cl[1001];
     46  CHAR cl[MAXCOMLINESTRG];
    4747  INT flags;
    4848  CHAR title[34];
     
    621621      {
    622622        COMMAND temp;
    623         char *psz[1002];
     623        PSZ psz;
    624624        APIRET ret;
    625625
     626        psz = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
    626627        memset(&temp, 0, sizeof(COMMAND));
    627628        WinQueryDlgItemText(hwnd, CMD_CL, sizeof(temp.cl), temp.cl);
    628         *psz = CheckApp_QuoteAddExe(temp.cl);
    629         memcpy(temp.cl, *psz, strlen(*psz) + 1);
     629        CheckApp_QuoteAddExe(psz, temp.cl);
     630        memcpy(temp.cl, psz, strlen(psz) + 1);
    630631        if (!strchr(temp.cl, '%')){
    631632          ret = saymsg(MB_YESNO,
     
    715716      {
    716717        COMMAND temp;
    717         CHAR *psz[1002];
     718        PSZ psz;
    718719        APIRET ret;
    719720
     721        psz = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
    720722        memset(&temp, 0, sizeof(COMMAND));
    721723        WinQueryDlgItemText(hwnd, CMD_CL, sizeof(temp.cl), temp.cl);
    722         *psz = CheckApp_QuoteAddExe(temp.cl);
    723         memcpy(temp.cl, *psz, strlen(*psz) + 1);
     724        CheckApp_QuoteAddExe(psz, temp.cl);
     725        memcpy(temp.cl, psz, strlen(psz) + 1);
    724726        if (!strchr(temp.cl, '%')){
    725727          ret = saymsg(MB_YESNO,
     
    814816    case CMD_REPLACE:
    815817      { //Delete first
    816         char *psz[1002];
     818        PSZ psz;
    817819        COMMAND temp;
    818820        APIRET ret;
    819821
     822        psz = xmalloc(MAXCOMLINESTRG, pszSrcFile, __LINE__);
    820823        memset(&temp, 0, sizeof(COMMAND));
    821824        WinQueryDlgItemText(hwnd, CMD_CL, sizeof(temp.cl), temp.cl);
    822         *psz = CheckApp_QuoteAddExe(temp.cl);
    823         memcpy(temp.cl, *psz, strlen(*psz) + 1);
     825        CheckApp_QuoteAddExe(psz, temp.cl);
     826        memcpy(temp.cl, psz, strlen(psz) + 1);
    824827        if (fCancelAction){
    825828          fCancelAction = FALSE;
Note: See TracChangeset for help on using the changeset viewer.