1b20a1774021cdcb07303801d55b7ca3fa6cff09 braney Wed Jan 8 05:54:20 2025 -0800 fix up chop functions so they don't call ArraySize with NULL diff --git src/lib/vcf.c src/lib/vcf.c index f23e9c5..e4d30ca 100644 --- src/lib/vcf.c +++ src/lib/vcf.c @@ -399,31 +399,31 @@ vcfFileErr(vcff, "Expected column %d's name in header to be \"%s\" or \"%s\" " "but got \"%s\"", ix+1, exp1, exp2, words[ix]); } } #define expectColumnName(vcff, exp, words, ix) expectColumnName2(vcff, exp, NULL, words, ix) #define VCF_MIN_COLUMNS 8 char *vcfDefaultHeader = "#CHROM POS ID REF ALT QUAL FILTER INFO"; /* Default header if we have none. */ static void parseColumnHeaderRow(struct vcfFile *vcff, char *line) /* Make sure column names are as we expect, and store genotype sample IDs if any are given. */ { -int wordCount = chopTabs(line+1, NULL); +int wordCount = chopTabsLen(line+1); char *words[wordCount]; chopTabs(line+1, words); if (wordCount < VCF_MIN_COLUMNS) errAbort("VCF header missing at least one of the required VCF fields"); expectColumnName(vcff, "CHROM", words, 0); expectColumnName(vcff, "POS", words, 1); expectColumnName(vcff, "ID", words, 2); expectColumnName(vcff, "REF", words, 3); expectColumnName(vcff, "ALT", words, 4); expectColumnName2(vcff, "QUAL", "PROB", words, 5); expectColumnName(vcff, "FILTER", words, 6); expectColumnName(vcff, "INFO", words, 7); if (wordCount > VCF_MIN_COLUMNS) { expectColumnName(vcff, "FORMAT", words, 8);