why is my code giving an abort message after compiling, or maybe there's another error?
int populate_array(int sin, int *sin_array) {
    int x = sin;
    int count = 0;
    while (x >= 1) {
        x = x / 10;
        count++;
    }
    if (count != 9) return 1;

    char sin_num[10];
    sprintf(sin_num, "%d", sin);
    //printf("%s\n", sin_num);

    for (int i = 0; i < 9; i++) {
        sin_array[i] = sin_num[i] - 48;
        //printf("%d\n", sin_array[i]);
    }
    sin_array[10] = '\0';

    return 0;
}

// TODO: Implement check_sin
/*
 * Return 0 if the given sin_array is a valid SIN, and 1 otherwise.
 */
int check_sin(int *sin_array) {
    char large_num[3];
    if (sin_array[0] == 0) return 1;
    int sum = 0;
    for (int i = 0; i < 9; i++) {
        //printf("*\n");
        if (i % 2 == 1) {
            if (sin_array[i] * 2 >= 10) {
                //printf("@\n");
                sprintf(large_num, "%d", sin_array[i] * 2);
                sum += (((int)large_num[0] - 48) + ((int)large_num[1] - 48));
                //printf("left: %d\n", (int)large_num[0] - 48);
                //printf("right: %d\n", (int)large_num[1] - 48);
                
                large_num[2] = '\0';
            }
            else {
                sum += (sin_array[i] * 2);
            }
        }
        else {
            //printf("#\n");
            sum += sin_array[i];
        }
        //printf("The Sum: %d\n", sum);
    }
    //printf("%d\n", sum);
    
    if (sum % 10 == 0) return 0;
    return 1;
}
int main(int argc, char **argv) {
    // TODO: Verify that command line arguments are valid.
    if (argc != 2) return 2;
    // TODO: Parse arguments and then call the two helpers in sin_helpers.c
    // to verify the SIN given as a command line argument.
    printf("********\n");
    int x = strtol(argv[1], NULL, 10);
    int y[10];
    int z = populate_array(x, y);
    printf("@@@@@@@@@@\n");
    if (z == 1) {
        printf("Invalid SIN\n");
        return 1;
    }
    if (check_sin(y) == 1) {
        printf("Invalid SIN\n");
        return 1;
    }
    printf("Valid SIN\n");
    printf("########\n");
    return 0;
}