diff options
author | FWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544> | 2011-12-09 15:37:22 +0000 |
---|---|---|
committer | FWoltermann@gmail.com <FWoltermann@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544> | 2011-12-09 15:37:22 +0000 |
commit | d489095bcdf9603053ebd514588093a991605ffb (patch) | |
tree | db03ad0a00e1466fef64290adfecd67bc9373d1c /nGenEx/PCX.CPP | |
parent | 4f272a3e310be77b4ba16fdfd2c9b6735f411037 (diff) | |
download | starshatter-d489095bcdf9603053ebd514588093a991605ffb.zip starshatter-d489095bcdf9603053ebd514588093a991605ffb.tar.gz starshatter-d489095bcdf9603053ebd514588093a991605ffb.tar.bz2 |
More string and fopen safety measures
Diffstat (limited to 'nGenEx/PCX.CPP')
-rw-r--r-- | nGenEx/PCX.CPP | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nGenEx/PCX.CPP b/nGenEx/PCX.CPP index 9782060..095df11 100644 --- a/nGenEx/PCX.CPP +++ b/nGenEx/PCX.CPP @@ -112,7 +112,7 @@ PcxImage::PcxImage(short w, short h, unsigned char* bits, unsigned char* colors) bitmap = new(__FILE__,__LINE__) unsigned char [imagebytes];
if (bitmap) {
- for (int i = 0; i < imagebytes; i++)
+ for (unsigned long i = 0; i < imagebytes; i++)
bitmap[i] = bits[i];
unsigned char* p = pal;
@@ -205,7 +205,7 @@ PcxImage::PcxImage(short w, short h, unsigned long* hibits) himap = new(__FILE__,__LINE__) unsigned long [imagebytes];
if (himap) {
- for (int i = 0; i < imagebytes; i++)
+ for (unsigned long i = 0; i < imagebytes; i++)
himap[i] = hibits[i];
}
}
@@ -225,7 +225,7 @@ int PcxImage::Load(char *filename) unsigned char abyte, *p;
FILE *f;
- f = fopen(filename,"rb");
+ fopen_s(&f, filename,"rb");
if (f == NULL)
return PCX_NOFILE;
@@ -437,7 +437,7 @@ int PcxImage::Save(char *filename) short mode=BYTEMODE;
FILE *f;
- f = fopen(filename,"wb");
+ fopen_s(&f, filename,"wb");
if (f == NULL)
return PCX_NOFILE;
|