diff options
| author | Howard Butler <howard@hobu.co> | 2015-10-05 15:14:48 -0500 |
|---|---|---|
| committer | Howard Butler <howard@hobu.co> | 2015-10-05 15:14:48 -0500 |
| commit | 9c17a17ae1ce955f5e080e3174262b13351aec03 (patch) | |
| tree | faafb878eebb933393c1cab578693466df49949e /src | |
| parent | be4798bc5eff6d564ed20d329996384d8afcb2d5 (diff) | |
| download | PROJ-9c17a17ae1ce955f5e080e3174262b13351aec03.tar.gz PROJ-9c17a17ae1ce955f5e080e3174262b13351aec03.zip | |
avoid read failure for minimal GTX files #269
Diffstat (limited to 'src')
| -rw-r--r-- | src/pj_gridinfo.c | 5 |
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 ); /* -------------------------------------------------------------------- */ |
