aboutsummaryrefslogtreecommitdiff
path: root/kmer_counts_per_sequence.c
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2014-01-31 19:51:05 -0500
committerCalvin Morrison <mutantturkey@gmail.com>2014-01-31 19:51:05 -0500
commit90280f4b00c2042ba9df5e3acc43cacd5d9c1930 (patch)
tree307a242e049991fd334167819074031a5efaf5d9 /kmer_counts_per_sequence.c
parent84e6803509f91fc01678f18ec634480463099b10 (diff)
fix argv/c checking
Diffstat (limited to 'kmer_counts_per_sequence.c')
-rw-r--r--kmer_counts_per_sequence.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/kmer_counts_per_sequence.c b/kmer_counts_per_sequence.c
index f725d5b..ac7ff44 100644
--- a/kmer_counts_per_sequence.c
+++ b/kmer_counts_per_sequence.c
@@ -20,6 +20,12 @@ int main(int argc, char **argv) {
size_t num_desired_indicies = 0;
size_t *desired_indicies = NULL;
+
+ if(argc < 3) {
+ printf("Please supply a filename and a kmer\n");
+ exit(EXIT_FAILURE);
+ }
+
unsigned long kmer = atoi(argv[2]);
if(kmer == 0) {
fprintf(stderr, "Error: invalid kmer.\n");
@@ -28,11 +34,6 @@ int main(int argc, char **argv) {
const unsigned long long width = (unsigned long long)1 << (kmer * 2);
- if(argc < 3) {
- printf("Please supply a filename and a kmer\n");
- exit(EXIT_FAILURE);
- }
-
if(argc == 4) {
specific_mers = true;
desired_indicies = malloc((width) * sizeof(size_t));