diff --git a/src/custom.h.in b/src/custom.h.in index 7416e03d..840aaf11 100644 --- a/src/custom.h.in +++ b/src/custom.h.in @@ -183,12 +183,12 @@ /*---------------------------------------------------------------------*/ /* How many global omits of the form YYYY MM DD do we handle? */ /*---------------------------------------------------------------------*/ -#define MAX_FULL_OMITS 250 +#define MAX_FULL_OMITS 500 /*---------------------------------------------------------------------*/ /* How many global omits of the form MM DD do we handle? */ /*---------------------------------------------------------------------*/ -#define MAX_PARTIAL_OMITS 250 +#define MAX_PARTIAL_OMITS 366 /*---------------------------------------------------------------------*/ /* A newline - some systems need "\n\r" */ diff --git a/src/omit.c b/src/omit.c index 08570460..af4de8b6 100644 --- a/src/omit.c +++ b/src/omit.c @@ -125,7 +125,7 @@ int PushOmitContext(ParsePtr p) free(context); return E_NO_MEM; } - + /* Copy the context over */ for (i=0; ifullsave + i) = FullOmitArray[i]; @@ -450,8 +450,11 @@ DoThroughOmit(ParsePtr p, int ystart, int mstart, int dstart) end = tmp; } + tmp = end - start + 1; + + /* Don't create any OMITs if there would be too many. */ + if (NumFullOmits + tmp >= MAX_FULL_OMITS) return E_2MANY_FULL; for (tmp = start; tmp <= end; tmp++) { - if (NumFullOmits == MAX_FULL_OMITS) return E_2MANY_FULL; if (!BexistsIntArray(FullOmitArray, NumFullOmits, tmp)) { InsertIntoSortedArray(FullOmitArray, NumFullOmits, tmp); NumFullOmits++;