I have a problem in the following part of my code in C:

```
  // reading pairs of parameters from input file
  while((read = fscanf(input_file, "%d %d\n", &type, &col)) > 0 ) {
    // checking reading errors
    if (read != 2 || (type < 0 && type > 4) || (col > 9)) {
     printf("Invalid input file format\n");
      return 2;
    }
    // putting tetromino corresponding to given parameters to the field
    if (put_tetromino(field, type, col) != 0) {
      // if result is not 0, the tetromnio is out of range. Returning error
      printf("Tetromino is out of field\n");
      return 2;
    }
  }

```

The input file looks like this:

```
5 0 
3 9
2 9
2 4 
..

```

In the above part of the code I want to check if the input file has the correct format.
I should have 2 columns: the first (type) has to be a value between 0 and 4 and the second (col) has to be a value between 0 and 9. If the input file contains a wrong format, for example:

```
9 8
4 9
2 5
..

```

I want to return 2. But the program doesn't return 2, it returns 0 at the end of the main-function.