Changeset 773 for trunk/dll/autoview.c


Ignore:
Timestamp:
Aug 7, 2007, 11:23:27 PM (18 years ago)
Author:
Steven Levine
Message:

Correct some compare directories collector nits
Use BldQuoted... functions
Move BldQuoted... functions near primary callers
Add RUNTYPE_MASK
Use Runtime_Error2 more

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/autoview.c

    r763 r773  
    351351                      if (info) {
    352352                        sprintf(p, "**%s%s%s\n",
    353                                 (info->id) ? info->id : "",
    354                                 (info->id) ? " " : "",
     353                                info->id ? info->id : "",
     354                                info->id ? " " : "",
    355355                                GetPString(IDS_ARCHIVETEXT));
    356356                        p += strlen(p);
     
    412412
    413413            static FILEFINDBUF4 ffb[130];
    414             CHAR fullname[CCHMAXPATH + 4];
    415             PSZ pszFullName = fullname, pszCurrFile = currfile, psz;
     414            CHAR fullname[CCHMAXPATH + 4];
    416415            HDIR hdir = HDIR_CREATE;
    417416            ULONG x, nm, ml, mc, bufflen;
    418417            PBYTE fb;
    419418            PFILEFINDBUF4 pffbFile;
    420             CHAR *buff, *p = "*";
    421             APIRET rc;
    422 
    423             psz = p;
    424             BldFullPathName(pszFullName, pszCurrFile, psz);
    425             *p = 0;
     419            PSZ pszBuf;
     420            PSZ p;
     421            APIRET rc;
     422
     423            BldFullPathName(fullname, currfile, "*");
    426424            //sprintf(fullname,
    427425            //        "%s%s*",
     
    452450              }
    453451              bufflen = (CCHMAXPATHCOMP + 42) * nm;
    454               buff = xmalloc(bufflen, pszSrcFile, __LINE__);
    455               if (buff) {
    456                 p = buff;
     452              pszBuf = xmalloc(bufflen, pszSrcFile, __LINE__);
     453              if (pszBuf) {
     454                p = pszBuf;
    457455                *p = 0;
    458456                fb = (PBYTE) & ffb;
     
    497495                  x++;
    498496                }                       // while
    499                 if (p - buff >= bufflen)
     497                if (p - pszBuf >= bufflen)
    500498                  Runtime_Error(pszSrcFile, __LINE__, pszBufOvfMsg);
    501                 if (*buff)
    502                   WinSetWindowText(hwndAutoview, buff);
    503                 free(buff);
     499                if (*pszBuf)
     500                  WinSetWindowText(hwndAutoview, pszBuf);
     501                free(pszBuf);
    504502              }
    505503            }
     
    516514          PGEA2 pgea;
    517515          PFEA2 pfea;
    518           CHAR *value, *buff, *p, *data;
     516          CHAR *value, *pszBuf, *p, *data;
    519517          USHORT len, type, plen, dlen;
    520518          BOOL readonly = FALSE;
     
    542540                  value[pfea->cbValue] = 0;
    543541                  if (*(USHORT *) value == EAT_MVMT) {
    544                     buff = xmalloc(65536, pszSrcFile, __LINE__);
    545                     if (buff) {
    546                       p = buff;
    547                       *buff = 0;
     542                    pszBuf = xmalloc(65536, pszSrcFile, __LINE__);
     543                    if (pszBuf) {
     544                      p = pszBuf;
     545                      *pszBuf = 0;
    548546                      data = value + (sizeof(USHORT) * 3);
    549547                      type = *(USHORT *) data;
     
    579577                        data += sizeof(USHORT);
    580578                      }                 // while
    581                       if (p - buff >= 65536) {
     579                      if (p - pszBuf >= 65536) {
    582580                        Runtime_Error(pszSrcFile, __LINE__, pszBufOvfMsg);
    583                         buff[65535] = 0;        // Try to stay alive
     581                        pszBuf[65535] = 0;      // Try to stay alive
    584582                        break;
    585583                      }
    586                       WinSetWindowText(hwndAutoMLE, buff);
    587                       free(buff);
     584                      WinSetWindowText(hwndAutoMLE, pszBuf);
     585                      free(pszBuf);
    588586                    }
    589587                  }
Note: See TracChangeset for help on using the changeset viewer.