Changeset 340


Ignore:
Timestamp:
Jul 26, 2006, 3:48:27 AM (19 years ago)
Author:
root
Message:

Check more run time errors

Location:
trunk/dll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/filter.c

    r123 r340  
    55
    66  Copyright (c) 1993-98 M. Kimes
    7   Copyright (c) 2004 Steven H.Levine
    8 
    9   Revisions     01 Aug 04 SHL - Rework lstrip/rstrip usage
     7  Copyright (c) 2004, 2006 Steven H.Levine
     8
     9  01 Aug 04 SHL Rework lstrip/rstrip usage
     10  22 Jul 06 SHL Check more run time errors
    1011
    1112***********************************************************************/
     
    1314#define INCL_WIN
    1415#define INCL_DOS
    15 
    1616#include <os2.h>
     17
    1718#include <stdio.h>
    1819#include <stdlib.h>
    1920#include <string.h>
    2021#include <share.h>
     22
    2123#include "fm3dll.h"
    2224#include "fm3dlg.h"
     
    2426
    2527#pragma data_seg(FILTER_DATA)
     28
     29static PSZ pszSrcFile = __FILE__;
     30
    2631#pragma alloc_text(FILTER,Filter)
    2732
     
    129134      bstripcr(s);
    130135      if(*s && *s != ';') {
    131         info = malloc(sizeof(LINKMASKS));
     136        info = xmalloc(sizeof(LINKMASKS),pszSrcFile,__LINE__);
    132137        if(info) {
    133           info->mask = strdup(s);
     138          info->mask = xstrdup(s,pszSrcFile,__LINE__);
    134139          if(info->mask) {
    135140            info->next = NULL;
     
    165170      strcat(s,"\\");
    166171    strcat(s,"FILTERS.DAT");
    167     fp = fopen(s,"w");
    168     if(fp) {
     172    fp = xfopen(s,"w",pszSrcFile,__LINE__);
     173    if (fp) {
    169174      fputs(GetPString(IDS_FILTERFILETEXT),fp);
    170175      info = maskhead;
     
    197202    info = info->next;
    198203  }
    199   info = malloc(sizeof(LINKMASKS));
     204  info = xmalloc(sizeof(LINKMASKS),pszSrcFile,__LINE__);
    200205  if(info) {
    201     info->mask = strdup(mask);
     206    info->mask = xstrdup(mask,pszSrcFile,__LINE__);
    202207    if(info->mask) {
    203208      info->next = NULL;
     
    634639              }
    635640              else
    636                 DosBeep(50,100);
     641                DosBeep(50,100);                // MSK_DELETE
    637642            }
    638643          }
  • trunk/dll/flesh.c

    r284 r340  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2005 Steven H. Levine
     9  Copyright (c) 2006 Steven H. Levine
    1010
    1111  24 May 05 SHL Rework Win_Error usage
     
    1313  28 May 05 SHL Clean while reading code
    1414  24 Oct 05 SHL Delete obsolete code
     15  22 Jul 06 SHL Check more run time errors
    1516
    1617***********************************************************************/
     
    1920#define INCL_DOSERRORS
    2021#define INCL_WIN
    21 
    2222#include <os2.h>
     23
    2324#include <stdarg.h>
    2425#include <stdio.h>
     
    3132
    3233#pragma data_seg(DATA1)
     34
     35static PSZ pszSrcFile = __FILE__;
     36
    3337#pragma alloc_text(FLESH,Flesh,FleshEnv,Unflesh,Stubby)
    3438
     
    6064    path[strlen(path) - 1] = 0;
    6165    if(!stricmp(path,"LIBPATH")) {
    62       var = malloc(65536);
     66      var = xmalloc(65536,pszSrcFile,__LINE__);
    6367      if(var)
    6468        LoadLibPath(var,65536);
     
    176180  BOOL        includefiles = fFilesInTree;
    177181
    178   if(!pciParent || (INT)pciParent == -1 || !hwndCnr)
     182  if (!pciParent || (INT)pciParent == -1 || !hwndCnr)
    179183    return FALSE;
    180184  pciL = (PCNRITEM)WinSendMsg(hwndCnr,
     
    466470                         MPFROMLONG(EXTRA_RECORD_BYTES2),
    467471                         MPFROMLONG(1L));
    468         if(pci) {
    469 
     472        if(!pci) {
     473          Win_Error(hwndCnr,HWND_DESKTOP,__FILE__,__LINE__,
     474                    GetPString(IDS_RECORDALLOCFAILEDTEXT));
     475        }
     476        else {
    470477          RECORDINSERT ri;
    471478
     
    486493            DosSleep(100L);
    487494            WinSetFocus(HWND_DESKTOP,hwndCnr);
    488             if(WinIsWindow((HAB)0,hwndCnr)) {
    489               if(WinSendMsg(hwndCnr,
    490                             CM_INSERTRECORD,
    491                             MPFROMP(pci),
    492                             MPFROMP(&ri)))
    493                 ret = TRUE;
    494               else {
     495            if (WinIsWindow((HAB)0,hwndCnr)) {
     496              if (!WinSendMsg(hwndCnr,
     497                             CM_INSERTRECORD,
     498                             MPFROMP(pci),
     499                             MPFROMP(&ri))) {
    495500                Win_Error(hwndCnr,HWND_DESKTOP,__FILE__,__LINE__,
    496501                          GetPString(IDS_RECORDINSERTFAILEDTEXT));
     
    499504                           MPFROMP(&pci),
    500505                           MPFROMSHORT(1));
    501               }
     506              }
     507              else
     508                ret = TRUE;
    502509            }
    503510          }
     
    505512            ret = TRUE;
    506513        }
    507         else
    508           Win_Error(hwndCnr,HWND_DESKTOP,__FILE__,__LINE__,
    509                     GetPString(IDS_RECORDALLOCFAILEDTEXT));
    510514      }
    511515      else if(toupper(*str) > 'B' && str[1] == ':' && str[2] == '\\' &&
Note: See TracChangeset for help on using the changeset viewer.