diff options
author | Calvin Morrison <mutantturkey@gmail.com> | 2013-12-06 17:19:00 -0500 |
---|---|---|
committer | Calvin Morrison <mutantturkey@gmail.com> | 2013-12-06 17:19:00 -0500 |
commit | bce70ffa642198d593680cb672e39b7b646ed0bd (patch) | |
tree | d2d4a3f42e00287575527ac435e3a364b4ddc12d /count_nucleobases.c | |
parent | 781b0d0be0863cff7ac8a382aba9765e61b5558d (diff) |
exit fail if fail
Diffstat (limited to 'count_nucleobases.c')
-rwxr-xr-x | count_nucleobases.c | 13 |
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'], |