parseFormat(): allocate space for PTOK_ARRAY too

This commit is contained in:
Дмитрий Левин 2005-06-29 22:26:42 +00:00
parent e57f5224ae
commit e79572e641

View File

@ -2214,7 +2214,7 @@ static int parseFormat(char * str, const headerTagTableEntry tags,
/* upper limit on number of individual formats */ /* upper limit on number of individual formats */
numTokens = 0; numTokens = 0;
for (chptr = str; *chptr != '\0'; chptr++) for (chptr = str; *chptr != '\0'; chptr++)
if (*chptr == '%') numTokens++; if (*chptr == '%' || *chptr == '[') numTokens++;
numTokens = numTokens * 2 + 1; numTokens = numTokens * 2 + 1;
format = xcalloc(numTokens, sizeof(*format)); format = xcalloc(numTokens, sizeof(*format));