From: <pan...@li...> - 2013-01-31 17:13:51
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/1299ba47658f changeset: 769:1299ba47658f user: tmodes date: Thu Jan 31 18:14:13 2013 +0100 description: Unified use of path length Check also length before copying [1057012] diffstat: panorama.h | 4 +--- tiff.c | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diffs (34 lines): diff -r b2f10b688fd6 -r 1299ba47658f panorama.h --- a/panorama.h Sat Jan 12 10:21:32 2013 +0100 +++ b/panorama.h Thu Jan 31 18:14:13 2013 +0100 @@ -393,8 +393,6 @@ int bitsPerPixel; // This is a common value to use } pano_ImageMetadata; -#define PANO_PATH_LEN 255 - // THe following constants define the number of parameters used by a projection // THe first is the number provided by the user. In most cases it is @@ -430,7 +428,7 @@ double pitch; double roll; cPrefs cP; // How to correct the image - char name[PANO_PATH_LEN+1]; + char name[MAX_PATH_LENGTH]; PTRect selection; CropInfo cropInformation; // TO BE DEPRECATED diff -r b2f10b688fd6 -r 1299ba47658f tiff.c --- a/tiff.c Sat Jan 12 10:21:32 2013 +0100 +++ b/tiff.c Thu Jan 31 18:14:13 2013 +0100 @@ -1544,8 +1544,7 @@ } //Store name of TIFF file - strncpy(im->name, fileName, PANO_PATH_LEN); - + snprintf(im->name, MAX_PATH_LENGTH, "%s", fileName); //printf("after update metadata tiff\n"); result = TRUE; |