diff options
-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 */ |