aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kmer_frequency_per_sequence.c2
-rw-r--r--kmer_total_count.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/kmer_frequency_per_sequence.c b/kmer_frequency_per_sequence.c
index 5fff8ba..5191b86 100644
--- a/kmer_frequency_per_sequence.c
+++ b/kmer_frequency_per_sequence.c
@@ -37,7 +37,7 @@ int main(int argc, char **argv) {
if(counts == NULL)
exit(EXIT_FAILURE);
- for(i = 0; i < strlen(line) - kmer; i++) {
+ for(i = 0; i < read - kmer; i++) {
counts[convert_kmer_to_index(&line[i], kmer, width)]++;
}
diff --git a/kmer_total_count.c b/kmer_total_count.c
index 48e64b5..23ca512 100644
--- a/kmer_total_count.c
+++ b/kmer_total_count.c
@@ -41,11 +41,11 @@ int main(int argc, char **argv) {
exit(EXIT_FAILURE);
while ((read = getline(&line, &len, fh)) != -1) {
- if(line[0] != '>') {
- for(i = 0; i < strlen(line) - kmer; i++) {
+ if(line[0] != '>') {
+ for(i = 0; i < read - kmer; i++) {
counts[convert_kmer_to_index(&line[i],kmer, width)]++;
}
- }
+ }
}
for(i = 0; i < width; i++)