why is the value of count always 0 at the end?
#include <stdio.h>
#include <stdlib.h>


// TODO: Implement a helper named check_permissions that matches the prototype below.
int check_permissions(char *file_perm, char *min_perm) {
    for (int i = 0; i < 9; i++) {
        if(file_perm[i] == '-' && min_perm[i] != '-') { 
            return 1;
        }
    }
    return 0;
}


int main(int argc, char** argv) {
    if (!(argc == 2 || argc == 3)) {
        fprintf(stderr, "USAGE: count_large size [permissions]\n");
        return 1;
    }

    // TODO: Process command line arguments.
    int min_size = strtol(argv[1], NULL, 10);
    char *min_permission;
    if (argc == 3) {
        min_permission = argv[2];
    }

    scanf("%*s"); //the first line of input from ls -l, to be discarded

    int count = 0; //the number of files large enough and have the right permission
    char* file_size = malloc(sizeof(long)); //the size of the file read by scanf
    char* file_permission = malloc(sizeof(char) * 9); //permission field of a file
    while (scanf("%*c%s %*s %*s %*s %s %*s %*s %*s %*s",file_permission, file_size) != EOF) {
        if (strtol(file_size, NULL, 10) >= min_size) { //checks if file is large enough
            if (argc == 2) {
                count++;
            }
            if (argc == 3){
                if(check_permissions(file_permission, min_permission) == 0) {
                    count++;
                }
            }            
        }
    }

    // TODO: Call check_permissions as part of your solution to count the files to
    // compute and print the correct value.

    printf("%d\n",count);

    return 0;
}
