a67466b94ea03dd7890183553292999d10197f30 hiram Mon Jan 6 12:01:26 2025 -0800 fix segfault error on missing -motif argument no redmine diff --git src/utils/findMotif/findMotif.c src/utils/findMotif/findMotif.c index fb0889a..9ee58e0 100644 --- src/utils/findMotif/findMotif.c +++ src/utils/findMotif/findMotif.c @@ -413,30 +413,33 @@ usage(); initBases(); maxAlloc = 2100000000 * (((sizeof(size_t)/4)*(sizeof(size_t)/4)*(sizeof(size_t)/4))); sprintLongWithCommas(asciiAlloc, (long long) maxAlloc); verbose(4, "#\tmaxAlloc: %s\n", asciiAlloc); setMaxAlloc(maxAlloc); /* produces: size_t is 4 == 2100000000 ~= 2^31 = 2Gb * size_t is 8 = 16800000000 ~= 2^34 = 16 Gb */ dnaUtilOpen(); +if (! optionExists("motif")) + errAbort("ERROR: Missing required -motif=<sequence> argument"); + motif = optionVal("motif", NULL); chr = optionVal("chr", NULL); strand = optionVal("strand", NULL); misMatch = optionInt("misMatch", misMatch); bedOutputOpt = optionExists("bedOutput"); wigOutput = optionExists("wigOutput"); if (wigOutput) bedOutputOpt = FALSE; else bedOutputOpt = TRUE; motifLen = strlen(motif); if (chr)