Changeset 351
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
trunk/dll/literal.c
r298 r351 14 14 01 Aug 04 SHL Rework fixup to avoid overflows 15 15 16 Jun 06 SHL liternal: comments 16 22 Jul 06 SHL Check more run time errors 16 17 17 18 ***********************************************************************/ … … 19 20 #define INCL_OS2 20 21 #define INCL_WIN 21 22 22 #include <os2.h> 23 23 24 #include <ctype.h> 24 25 #include <stdlib.h> 25 26 #include <stdio.h> 26 27 #include <string.h> 28 27 29 #include "fm3dll.h" 30 31 static PSZ pszSrcFile = __FILE__; 28 32 29 33 static INT index(const CHAR *s,const CHAR c); … … 88 92 return 0; 89 93 cBufBytes = strlen(pszBuf) + 1; 90 pszWork = pszOut = malloc(cBufBytes + 1);94 pszWork = pszOut = xmalloc(cBufBytes + 1,pszSrcFile,__LINE__); 91 95 92 96 iBuf = 0; /* set index to first character */  - 
      
trunk/dll/loadbmp.c
r2 r351 1 2 /*********************************************************************** 3 4 $Id$ 5 6 Load bitmaps 7 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2006 Steven H.Levine 10 11 22 Jul 06 SHL Check more run time errors 12 13 ***********************************************************************/ 14 1 15 #define INCL_DOS 2 16 #define INCL_WIN 3 17 #define INCL_GPI 4 5 18 #include <os2.h> 19 6 20 #include <stdlib.h> 7 21 #include <stdio.h> 8 22 #include <string.h> 9 23 #include <share.h> 24 10 25 #include "fm3dll.h" 11 26 27 static PSZ pszSrcFile = __FILE__; 28 12 29 #pragma alloc_text(LOADBITMAP,LoadBitmapFromFile,LoadBitmapFromFileNum) 13 30 14 31 15 HBITMAP LoadBitmapFromFileNum (USHORT id) {16 17 char s[CCHMAXPATH];32 HBITMAP LoadBitmapFromFileNum (USHORT id) 33 { 34 char s[CCHMAXPATH]; 18 35 19 36 save_dir2(s); … … 23 40 24 41 25 HBITMAP LoadBitmapFromFile (CHAR *pszFileName) {26 42 HBITMAP LoadBitmapFromFile (CHAR *pszFileName) 43 { 27 44 HBITMAP hBmp = (HBITMAP)0; 28 45 FILE *File; … … 30 47 USHORT usType = 0; // #@!!! compiler warnings 31 48 PBITMAPARRAYFILEHEADER2 pbafh2 = NULL; // (MAM) chng init values to NULL instead of ptr to 0 32 PBITMAPFILEHEADER2 pbfh2 = NULL; 33 PBITMAPINFOHEADER2 pbih2 = NULL; 34 PBITMAPINFO2 pbmi2 = NULL; 35 PBITMAPARRAYFILEHEADER pbafh = NULL; 36 PBITMAPFILEHEADER pbfh = NULL; 37 PBITMAPINFOHEADER pbih = NULL; 49 PBITMAPFILEHEADER2 pbfh2 = NULL; 50 PBITMAPINFOHEADER2 pbih2 = NULL; 51 PBITMAPINFO2 pbmi2 = NULL; 52 PBITMAPARRAYFILEHEADER pbafh = NULL; 53 PBITMAPFILEHEADER pbfh = NULL; 54 PBITMAPINFOHEADER pbih = NULL; 38 55 BOOL f2; // format 1.x or 2.x 39 56 ULONG ulOffset; … … 56 73 /* Next read the bitmap info header........................................*/ 57 74 // we allocate enough to hold a complete bitmap array file header 58 pbafh2 = (PBITMAPARRAYFILEHEADER2)malloc(sizeof(*pbafh2) + 59 256 * sizeof(RGB2)); 75 pbafh2 = xmalloc(sizeof(*pbafh2) + 256 * sizeof(RGB2),pszSrcFile,__LINE__); 60 76 if(!pbafh2) 61 77 goto ExitLoadBMP; … … 248 264 ulDataSize = (((pbmi2->cBitCount * pbmi2->cx) + 31) / 32) * 4 * 249 265 pbmi2->cy * pbmi2->cPlanes; 250 pData = (PBYTE)malloc(ulDataSize);266 pData = xmalloc(ulDataSize,pszSrcFile,__LINE__); 251 267 if(!pData) 252 268 goto ExitLoadBMP; … … 263 279 264 280 ExitLoadBMP: 265 if(pData) 266 free(pData); 267 if(pbafh2) 268 free(pbafh2); 281 282 xfree(pData); 283 xfree(pbafh2); 269 284 fclose(File); 270 285 WinReleasePS(hPS); 271 return (hBmp);286 return hBmp; 272 287 } 273 288  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  