diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2007-04-10 18:02:12 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2007-04-10 18:02:12 (GMT) |
commit | 7c328777d059afb282b5e8d1a0653b9f1f7c7441 (patch) | |
tree | a152059bd822a69afb36cc977c7f45e760e26394 | |
parent | a4c2816077f970a677661c9b78855ddf32c4c2f2 (diff) | |
download | hdf5-7c328777d059afb282b5e8d1a0653b9f1f7c7441.zip hdf5-7c328777d059afb282b5e8d1a0653b9f1f7c7441.tar.gz hdf5-7c328777d059afb282b5e8d1a0653b9f1f7c7441.tar.bz2 |
[svn-r13624]
bug fix
eliminate a 64 limit size of an input file
tested : linux
-rw-r--r-- | hl/tools/gif2h5/gif.h | 3 | ||||
-rw-r--r-- | hl/tools/gif2h5/gif2hdf.c | 17 |
2 files changed, 6 insertions, 14 deletions
diff --git a/hl/tools/gif2h5/gif.h b/hl/tools/gif2h5/gif.h index 031c141..737b7de 100644 --- a/hl/tools/gif2h5/gif.h +++ b/hl/tools/gif2h5/gif.h @@ -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; diff --git a/hl/tools/gif2h5/gif2hdf.c b/hl/tools/gif2h5/gif2hdf.c index 34aad1d..99dc3fd 100644 --- a/hl/tools/gif2h5/gif2hdf.c +++ b/hl/tools/gif2h5/gif2hdf.c @@ -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 */ |