aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHoward Butler <howard@hobu.co>2015-10-05 15:14:48 -0500
committerHoward Butler <howard@hobu.co>2015-10-05 15:14:48 -0500
commit9c17a17ae1ce955f5e080e3174262b13351aec03 (patch)
treefaafb878eebb933393c1cab578693466df49949e /src
parentbe4798bc5eff6d564ed20d329996384d8afcb2d5 (diff)
downloadPROJ-9c17a17ae1ce955f5e080e3174262b13351aec03.tar.gz
PROJ-9c17a17ae1ce955f5e080e3174262b13351aec03.zip
avoid read failure for minimal GTX files #269
Diffstat (limited to 'src')
-rw-r--r--src/pj_gridinfo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pj_gridinfo.c b/src/pj_gridinfo.c
index 3d34dd7e..d7390847 100644
--- a/src/pj_gridinfo.c
+++ b/src/pj_gridinfo.c
@@ -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 )
@@ -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 );
/* -------------------------------------------------------------------- */