From 412e242109c8ba495c5545292645d6169120c62c Mon Sep 17 00:00:00 2001 From: "David F. Skoll" Date: Tue, 31 Aug 2010 12:27:23 -0400 Subject: [PATCH] Don't create any OMITs with THROUGH if there would be too many. Bump max full omits to 500 and partial omits to 366. --- src/custom.h.in | 4 ++-- src/omit.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) 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++;