Why segmentation fault occur in this code
int main(int argc, char** argv) {
    if (!(argc == 2 || argc == 3)) {
        fprintf(stderr, "USAGE: count_large size [permissions]\n");
        return 1;
    }
    int filesize=0;
    int threshold = strtol(argv[1], NULL, 10);
    printf("%d\n", threshold);
    char *permissions=NULL;
    int count = 0;
    scanf("%*s %*d");
    while(scanf("%s %*d %*s %*s %d %*s %*d %*s %*s\n", permissions,&filesize) != EOF) {
        if(argc == 2) {
            if(filesize > threshold){
            count +=1;
            }
        }
    }
    printf("%d\n", count);

    return 0;
}