Changeset 328 for trunk/dll/uudecode.c


Ignore:
Timestamp:
Jul 25, 2006, 8:37:24 PM (19 years ago)
Author:
root
Message:

Use Runtime_Error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/uudecode.c

    r204 r328  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2005 Steven H. Levine
     9  Copyright (c) 2005, 2006 Steven H. Levine
    1010
    1111  06 Jun 05 SHL Indent -i2
    1212  06 Jun 05 SHL Drop unused code
     13  17 Jul 06 SHL Use Runtime_Error
    1314
    1415***********************************************************************/
     
    1617#define INCL_DOS
    1718#define INCL_WIN
    18 
    1919#include <os2.h>
     20
    2021#include <stdlib.h>
    2122#include <stdio.h>
    2223#include <string.h>
    2324#include <share.h>
     25
    2426#include "fm3dll.h"
    2527#include "fm3dlg.h"
    2628#include "fm3str.h"
     29
     30static PSZ pszSrcFile = __FILE__;
    2731
    2832/* prototypes */
     
    395399                                      MPVOID,
    396400                                      MPVOID);
    397         for (y = 0; y < x; y++)
    398         {
     401        for (y = 0; y < x; y++) {
    399402          *szBuffer = 0;
    400403          WinSendDlgItemMsg(hwnd,
     
    403406                            MPFROM2SHORT(y, CCHMAXPATH),
    404407                            MPFROMP(szBuffer));
    405           if (*szBuffer)
    406           {
     408          if (*szBuffer) {
    407409            error = AddToList(szBuffer,
    408410                              &list,
    409411                              &numfiles,
    410412                              &numalloc);
    411             if (error)
    412             {
    413               DosBeep(250, 100);
     413            if (error) {
     414              Runtime_Error(pszSrcFile, __LINE__, "AddToList");
    414415              break;
    415416            }
     
    418419        if (numfiles && list && numfiles + 1 < numalloc)
    419420        {
    420           test = realloc(list, sizeof(CHAR *) * (numfiles + 1));
     421          test = xrealloc(list, sizeof(CHAR *) * (numfiles + 1),pszSrcFile,__LINE__);
    421422          if (test)
    422423            list = test;
    423424        }
    424         if (list && list[0])
    425         {
     425        if (!list || !list[0]) {
     426          Runtime_Error(pszSrcFile, __LINE__, "no data");
     427          break;
     428        }
     429        else {
    426430          FreeList(wk -> li -> list);
    427431          wk -> li -> list = list;
    428432        }
    429         else
    430         {
    431           DosBeep(50, 100);
    432           break;
    433         }
    434433      }
    435434      WinDismissDlg(hwnd, 1);
    436435      break;
    437     }
     436    } // switch WM_COMMAND mp1
    438437    return 0;
    439   }
     438  } // switch msg
    440439  return WinDefDlgProc(hwnd, msg, mp1, mp2);
    441440}
Note: See TracChangeset for help on using the changeset viewer.