aboutsummaryrefslogtreecommitdiff
path: root/count_nucleobases.c
diff options
context:
space:
mode:
Diffstat (limited to 'count_nucleobases.c')
-rwxr-xr-xcount_nucleobases.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/count_nucleobases.c b/count_nucleobases.c
index fbf4ce2..1b432da 100755
--- a/count_nucleobases.c
+++ b/count_nucleobases.c
@@ -6,7 +6,7 @@
#include <stdbool.h>
int main() {
- ssize_t len = 0;
+ size_t len = 0;
unsigned long long counts[256] = {0};
@@ -32,8 +32,15 @@ int main() {
}
}
}
- } else { fprintf(stderr, "this does not look like a fasta file\n"); }
- } else { fprintf(stderr, "could not read file\n"); }
+ }
+ else {
+ fprintf(stderr, "this does not look like a fasta file\n");
+ exit(EXIT_FAILURE);
+ }
+ } else {
+ fprintf(stderr, "could not read file\n");
+ exit(EXIT_FAILURE);
+ }
printf("A:%llu\nC:%llu\nG:%llu\nT:%llu\n",
counts['a'] + counts['A'],