diff --git a/ogr/ogrsf_frmts/miramon/mm_gdal_driver_structs.h b/ogr/ogrsf_frmts/miramon/mm_gdal_driver_structs.h index 2e9320df42d5..84548492f338 100644 --- a/ogr/ogrsf_frmts/miramon/mm_gdal_driver_structs.h +++ b/ogr/ogrsf_frmts/miramon/mm_gdal_driver_structs.h @@ -20,9 +20,11 @@ CPL_C_START // Necessary for compiling in GDAL project #define KEY_Vers "Vers" #define KEY_SubVers "SubVers" #define MM_VERS 4 +#define MM_SUBVERS_ACCEPTED 0 #define MM_SUBVERS 3 #define KEY_VersMetaDades "VersMetaDades" #define KEY_SubVersMetaDades "SubVersMetaDades" +#define MM_VERS_METADADES_ACCEPTED 4 #define MM_VERS_METADADES 5 #define MM_SUBVERS_METADADES 0 #define SECTION_METADADES "METADADES" diff --git a/ogr/ogrsf_frmts/miramon/mm_wrlayr.c b/ogr/ogrsf_frmts/miramon/mm_wrlayr.c index f945d9bc2cd2..3af35c78a5d7 100644 --- a/ogr/ogrsf_frmts/miramon/mm_wrlayr.c +++ b/ogr/ogrsf_frmts/miramon/mm_wrlayr.c @@ -6104,16 +6104,16 @@ int MMCheck_REL_FILE(const char *szREL_file) return 1; } - // SubVers>=3? + // SubVers>=0? pszLine = MMReturnValueFromSectionINIFile(szREL_file, SECTION_VERSIO, KEY_SubVers); if (pszLine) { - if (*pszLine == '\0' || atoi(pszLine) < (int)MM_SUBVERS) + if (*pszLine == '\0' || atoi(pszLine) < (int)MM_SUBVERS_ACCEPTED) { MMCPLError(CE_Failure, CPLE_OpenFailed, "The file \"%s\" must have %s>=%d.", szREL_file, - KEY_SubVers, MM_SUBVERS); + KEY_SubVers, MM_SUBVERS_ACCEPTED); free_function(pszLine); return 1; @@ -6124,20 +6124,20 @@ int MMCheck_REL_FILE(const char *szREL_file) { MMCPLError(CE_Failure, CPLE_OpenFailed, "The file \"%s\" must have %s>=%d.", szREL_file, KEY_SubVers, - MM_SUBVERS); + MM_SUBVERS_ACCEPTED); return 1; } - // VersMetaDades>=5? + // VersMetaDades>=4? pszLine = MMReturnValueFromSectionINIFile(szREL_file, SECTION_VERSIO, KEY_VersMetaDades); if (pszLine) { - if (*pszLine == '\0' || atoi(pszLine) < (int)MM_VERS_METADADES) + if (*pszLine == '\0' || atoi(pszLine) < (int)MM_VERS_METADADES_ACCEPTED) { MMCPLError(CE_Failure, CPLE_OpenFailed, "The file \"%s\" must have %s>=%d.", szREL_file, - KEY_VersMetaDades, MM_VERS_METADADES); + KEY_VersMetaDades, MM_VERS_METADADES_ACCEPTED); free_function(pszLine); return 1; } @@ -6147,7 +6147,7 @@ int MMCheck_REL_FILE(const char *szREL_file) { MMCPLError(CE_Failure, CPLE_OpenFailed, "The file \"%s\" must have %s>=%d.", szREL_file, - KEY_VersMetaDades, MM_VERS_METADADES); + KEY_VersMetaDades, MM_VERS_METADADES_ACCEPTED); return 1; }