[svn-r13624]

bug fix		
eliminate a 64 limit size of an input file

tested : linux
This commit is contained in:
Pedro Vicente Nunes 2007-04-10 13:02:12 -05:00
parent a4c2816077
commit 7c328777d0
2 changed files with 6 additions and 14 deletions

View File

@ -28,9 +28,6 @@
#define MAX_PAL 768
/* set the name length restriction to 64 charachters */
#define VSNAMELENMAX 64 /* this is a carryover from HDF4 */
/* typedef H5T_NATIVE_UINT8 BYTE; */
typedef unsigned char BYTE;

View File

@ -33,9 +33,8 @@ main(int argv , char *argc[])
BYTE *MemGif;
BYTE *StartPos;
/* VSNAMELENMAX is a carryover from HDF4 and is #defined to 256 in gif.h */
char GIFFileName[VSNAMELENMAX];
char HDFFileName[VSNAMELENMAX];
char *GIFFileName;
char *HDFFileName;
/*
* Initialize all GifMemoryStruct pointers to null to prevent hassles
@ -53,15 +52,11 @@ main(int argv , char *argc[])
return(-1);
}
strncpy(GIFFileName , argc[1] , (size_t)(VSNAMELENMAX - 1));
strncpy(HDFFileName , argc[2] , (size_t)(VSNAMELENMAX - 1));
GIFFileName[VSNAMELENMAX - 1] = '\0';
HDFFileName[VSNAMELENMAX - 1] = '\0';
GIFFileName = argc[1];
HDFFileName = argc[2];
if (!(fpGif = fopen(GIFFileName,"rb"))) {
printf("Unable to open GIF file for reading.\n");
printf("Filename (including path) must be less than %d charachters in length\n",
VSNAMELENMAX);
exit(-1);
}
@ -78,7 +73,7 @@ main(int argv , char *argc[])
exit (-1);
}
if (fread(MemGif,(size_t)filesize,(size_t)1,fpGif) != 1) {
if (fread(MemGif,(size_t)filesize,1,fpGif) != 1) {
printf("Corrupted Input File");
exit(-1);
}
@ -102,7 +97,7 @@ main(int argv , char *argc[])
* Call WriteHDF from here. Go ahead and change WriteHDF to write whatever
* format you want
*/
if (WriteHDF(GifMemoryStruct , argc[2] , argc[1]))
if (WriteHDF(GifMemoryStruct , HDFFileName , GIFFileName))
printf("HDF Write Error\n\n");
/* Free all buffers */