Skip to content

Commit

Permalink
r.in.gridatb: check if opening of file succeeds (OSGeo#4532)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShubhamDesai authored Oct 16, 2024
1 parent bc9cb2a commit 2415894
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions raster/r.in.gridatb/file_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ void rdwr_gridatb(void)
float idx;

fp = fopen(file, "r");
if (!fp) {
G_fatal_error(_("Unable to open file: %s"), file);
}

buf[0] = 0;
if (fscanf(fp, "%[^\n]", buf) != 1)
Expand Down

0 comments on commit 2415894

Please sign in to comment.