diff --git a/07/solution.c b/07/solution.c index e7dff0d..cadd59a 100644 --- a/07/solution.c +++ b/07/solution.c @@ -51,7 +51,7 @@ entry *addent(entry *parent, int isdir, const char *name) { return e; } -int main(void) { +int main(int argc, char **argv) { char l[64]; entry *root = calloc(1, sizeof(entry)); root->isdir++; @@ -84,7 +84,10 @@ int main(void) { } current = root; - required = 30000000UL - (70000000UL - root->size); + if (argc == 3) + required = strtoul(argv[2], NULL, 10) - (strtoul(argv[1], NULL, 10) - root->size); + else + required = 30000000UL - (70000000UL - root->size); do { if (current->n_entries) { current->n_entries--;