Browse Source

- fixed returncode handling

- removed superflous count variable
master
Andreas Romeyke 4 years ago
parent
commit
faa3b4746c
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      src/check_datetime.c

+ 6
- 5
src/check_datetime.c View File

@ -54,8 +54,8 @@ int check_datetime(const char * filename ) {
};
/* find date-tag and fix it */
char *datetime=NULL;
uint32 count=0;
int found=TIFFGetField(tif, TIFFTAG_DATETIME, &datetime, &count);
int returncode = 0;
int found=TIFFGetField(tif, TIFFTAG_DATETIME, &datetime);
if (1==found) { /* there exists a datetime field */
int day=0;
int month=0;
@ -65,14 +65,15 @@ int check_datetime(const char * filename ) {
int sec=0;
if (6 == sscanf(datetime, "%04d:%02d:%02d%02d:%02d:%02d", &year, &month, &day, &hour, &min, &sec)) {
return test_plausibility(&year, &month, &day, &hour, &min, &sec);
returncode = test_plausibility(&year, &month, &day, &hour, &min, &sec);
} else {
return -2;
returncode=-2;
}
} else if (0 == found) {
if (FLAGGED == flag_be_verbose) printf ("no datetime found!\n");
}
TIFFClose(tif);
return FIXIT_TIFF_IS_VALID;
if (0 == returncode) return FIXIT_TIFF_IS_VALID;
else return FIXIT_TIFF_IS_INVALID;
}

Loading…
Cancel
Save