From 7c328777d059afb282b5e8d1a0653b9f1f7c7441 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Tue, 10 Apr 2007 13:02:12 -0500 Subject: [PATCH] [svn-r13624] bug fix eliminate a 64 limit size of an input file tested : linux --- hl/tools/gif2h5/gif.h | 3 --- 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 031c141222..737b7debc8 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 34aad1dbfb..99dc3fd65e 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 */