Skip to content

Commit

Permalink
Merge pull request #315 from OSGeo/issues-269-gridinfo-ctx
Browse files Browse the repository at this point in the history
avoid read failure for minimal GTX files #269
  • Loading branch information
hobu committed Oct 6, 2015
2 parents 8f0427b + 9c17a17 commit 6eabf3c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pj_gridinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi )
/* Seek a parent grid file by name from a grid list */
/************************************************************************/

static PJ_GRIDINFO* pj_gridinfo_parent( PJ_GRIDINFO *gilist,
static PJ_GRIDINFO* pj_gridinfo_parent( PJ_GRIDINFO *gilist,
const char *name, int length )
{
while( gilist )
Expand Down Expand Up @@ -863,6 +863,9 @@ PJ_GRIDINFO *pj_gridinfo_init( projCtx ctx, const char *gridname )
return gilist;
}

/* some files may be smaller that sizeof(header), eg 160, so */
ctx->last_errno = 0; /* don't treat as a persistent error */

pj_ctx_fseek( ctx, fp, SEEK_SET, 0 );

/* -------------------------------------------------------------------- */
Expand Down

0 comments on commit 6eabf3c

Please sign in to comment.