From bce70ffa642198d593680cb672e39b7b646ed0bd Mon Sep 17 00:00:00 2001 From: Calvin Morrison Date: Fri, 6 Dec 2013 17:19:00 -0500 Subject: exit fail if fail --- count_nucleobases.c | 13 ++++++++++--- 1 file 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 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'], -- cgit v1.2.3