3d7b476fc7a80bb445107cf2f6cdfd10070f4321 angie Mon Aug 28 14:07:40 2017 -0700 Use pointer subtraction instead of strlen, HT Braney in code review, refs #19992 diff --git src/lib/dnaseq.c src/lib/dnaseq.c index 2eaee42..8a57f93 100644 --- src/lib/dnaseq.c +++ src/lib/dnaseq.c @@ -139,31 +139,31 @@ * translate. If stop is TRUE then stop at first stop codon. (Otherwise * represent stop codons as 'Z'). */ { return translateSeqN(inSeq, offset, 0, stop); } void aaSeqZToX(aaSeq *aa) /* If seq has a 'Z' for stop codon, possibly followed by other bases, change the 'Z' to an X * (compatible with dnautil's aminoAcidTable) and truncate there. */ { char *p = strchr(aa->dna, 'Z'); if (p) { *p++ = 'X'; *p = '\0'; - aa->size = strlen(aa->dna); + aa->size = p - aa->dna; } } bioSeq *whichSeqIn(bioSeq **seqs, int seqCount, char *letters) /* Figure out which if any sequence letters is in. */ { aaSeq *seq; int i; for (i=0; idna <= letters && letters < seq->dna + seq->size) return seq; }