Don't create any OMITs with THROUGH if there would be too many.

Bump max full omits to 500 and partial omits to 366.
This commit is contained in:
David F. Skoll
2010-08-31 12:27:23 -04:00
parent e827516b72
commit 412e242109
2 changed files with 7 additions and 4 deletions

View File

@@ -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" */

View File

@@ -125,7 +125,7 @@ int PushOmitContext(ParsePtr p)
free(context);
return E_NO_MEM;
}
/* Copy the context over */
for (i=0; i<NumFullOmits; i++)
*(context->fullsave + 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++;