--- parser3/src/classes/image.C 2003/03/24 17:12:33 1.90.2.15.2.16 +++ parser3/src/classes/image.C 2003/04/02 10:10:00 1.90.2.15.2.19 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_IMAGE_C="$Date: 2003/03/24 17:12:33 $"; +static const char* IDENT_IMAGE_C="$Date: 2003/04/02 10:10:00 $"; /* jpegsize: gets the width and height (in pixels) of a jpeg file @@ -396,17 +396,16 @@ static Value* parse_IFD_entry_formatted_ // date.C time_t cstr_to_time_t(char *cstr, bool fail_on_error); -static Value* parse_IFD_entry_formatted_value( - bool is_big, ushort format, - size_t component_size, uint components_count, - const uchar *value) { +static Value* parse_IFD_entry_formatted_value(bool is_big, ushort format, + size_t component_size, uint components_count, + const uchar *value) { if(format==2) { // ascii string, exception: the only type with varying size const char* cstr=(const char* )value; - size_t size=components_count; + size_t length=components_count; // Data format is "YYYY:MM:DD HH:MM:SS"+0x00, total 20bytes - if(size==JPEG_EXIF_DATE_CHARS + if(length==JPEG_EXIF_DATE_CHARS && isdigit(cstr[0]) - && cstr[JPEG_EXIF_DATE_CHARS-1]==0) { + && cstr[length-1]==0) { char cstr_writable[JPEG_EXIF_DATE_CHARS]; strcpy(cstr_writable, cstr); @@ -416,9 +415,9 @@ static Value* parse_IFD_entry_formatted_ return new VDate(t); } - if(const char* premature_zero_pos=(const char* )memchr(cstr, 0, size)) - size=premature_zero_pos-cstr; - return new VString(*new String(cstr, size, true/*tainted*/)); + if(const char* premature_zero_pos=(const char* )memchr(cstr, 0, length)) + length=premature_zero_pos-cstr; + return new VString(*new String(cstr, length, true/*tainted*/)); } if(components_count==1) @@ -428,7 +427,7 @@ static Value* parse_IFD_entry_formatted_ HashStringValue& hash=result->hash(); for(uint i=0; i