Changeset 1398 for trunk/dll/saveclip.c


Ignore:
Timestamp:
Feb 21, 2009, 6:43:00 PM (17 years ago)
Author:
Gregg Young
Message:

Move embeded strings to PCSZ variables or string table; Eliminate Error2 functions Runtime_Error with NULL format string returns "No data" error. Change declares from PSZ to PCSZ in functions where the variable isn't changed. Added btm as an executable file type in several additional places. Use fProtectOnly to prevent attempt to execute Dos and Win programs on "Protect only" installs in several additional places.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/saveclip.c

    r1397 r1398  
    245245  case WM_INITDLG:
    246246    if (!mp2) {
    247       Runtime_Error(pszSrcFile, __LINE__, "no data");
     247      Runtime_Error(pszSrcFile, __LINE__, NULL);
    248248      WinDismissDlg(hwnd, 0);
    249249    }
     
    281281        CHAR s[CCHMAXPATH + 14];
    282282
    283         BldFullPathName(s, pFM2SaveDirectory, "PATTERNS.DAT");
     283        BldFullPathName(s, pFM2SaveDirectory, PCSZ_PATTERNSDAT);
    284284        fp = _fsopen(s, "r", SH_DENYWR);
    285285        if (fp) {
     
    308308                                       LM_QUERYITEMCOUNT, MPVOID, MPVOID);
    309309      if (sMax > 0) {
    310         BldFullPathName(szBuffer, pFM2SaveDirectory, "PATTERNS.DAT");
     310        BldFullPathName(szBuffer, pFM2SaveDirectory, PCSZ_PATTERNSDAT);
    311311        if (CheckDriveSpaceAvail(szBuffer, ullDATFileSpaceNeeded, 1) == 2)
    312312          break; //already gave error msg
     
    327327      }
    328328      else if (!sMax) {
    329         BldFullPathName(szBuffer, pFM2SaveDirectory, "PATTERNS.DAT");
     329        BldFullPathName(szBuffer, pFM2SaveDirectory, PCSZ_PATTERNSDAT);
    330330        unlinkf("%s", szBuffer);
    331331      }
     
    382382        if (export_filename(hwnd, savename, 1) && *savename) {
    383383          if (!strchr(savename, '.'))
    384             strcat(savename, ".LST");
     384            strcat(savename, PCSZ_DOTLST);
    385385          WinSetDlgItemText(hwnd, SAV_FILENAME, savename);
    386386        }
     
    457457        if (stricmp(savename, "PRN") &&
    458458            strnicmp(savename, "\\DEV\\LPT", 8) && !strchr(savename, '.'))
    459           strcat(savename, ".LST");
     459          strcat(savename, PCSZ_DOTLST);
    460460        PrfWriteProfileString(fmprof, appname, "SaveToListName", savename);
    461461        pci = (PCNRITEM) WinSendMsg(hwndCnr,
     
    471471        }
    472472        if (!pci || (INT) pci == -1)
    473           Runtime_Error(pszSrcFile, __LINE__, "no data");
     473          Runtime_Error(pszSrcFile, __LINE__, NULL);
    474474        else {
    475475          fp = _fsopen(savename, "w+", SH_DENYWR);
     
    605605  case WM_INITDLG:
    606606    if (!mp2) {
    607       Runtime_Error(pszSrcFile, __LINE__, "no data");
     607      Runtime_Error(pszSrcFile, __LINE__, NULL);
    608608      WinDismissDlg(hwnd, 0);
    609609    }
     
    641641        CHAR s[CCHMAXPATH + 14];
    642642
    643         BldFullPathName(s, pFM2SaveDirectory, "PATTERNS.DAT");
     643        BldFullPathName(s, pFM2SaveDirectory, PCSZ_PATTERNSDAT);
    644644        fp = _fsopen(s, "r", SH_DENYWR);
    645645        if (fp) {
     
    669669                                       LM_QUERYITEMCOUNT, MPVOID, MPVOID);
    670670      if (sMax > 0) {
    671         BldFullPathName(szBuffer, pFM2SaveDirectory, "PATTERNS.DAT");
     671        BldFullPathName(szBuffer, pFM2SaveDirectory, PCSZ_PATTERNSDAT);
    672672        if (CheckDriveSpaceAvail(szBuffer, ullDATFileSpaceNeeded, 1) == 2)
    673673          break; //already gave error msg
     
    688688      }
    689689      else if (!sMax) {
    690         BldFullPathName(szBuffer, pFM2SaveDirectory, "PATTERNS.DAT");
     690        BldFullPathName(szBuffer, pFM2SaveDirectory, PCSZ_PATTERNSDAT);
    691691        unlinkf("%s", szBuffer);
    692692      }
     
    743743        if (export_filename(hwnd, savename, 1) && *savename) {
    744744          if (!strchr(savename, '.'))
    745             strcat(savename, ".LST");
     745            strcat(savename, PCSZ_DOTLST);
    746746          WinSetDlgItemText(hwnd, SAV_FILENAME, savename);
    747747        }
     
    820820        if (stricmp(savename, "PRN") &&
    821821            strnicmp(savename, "\\DEV\\LPT", 8) && !strchr(savename, '.'))
    822           strcat(savename, ".LST");
     822          strcat(savename, PCSZ_DOTLST);
    823823        PrfWriteProfileString(fmprof, appname, "SaveToListName", savename);
    824824        if (!list || !list[0])
    825           Runtime_Error(pszSrcFile, __LINE__, "no data");
     825          Runtime_Error(pszSrcFile, __LINE__, NULL);
    826826        else {
    827827          fp = _fsopen(savename, "r+", SH_DENYWR);
Note: See TracChangeset for help on using the changeset viewer.